<!DOCTYPE html><html class=split lang=en-US-x-hixie><script src=../link-fixup.js defer=""></script>
<!-- Mirrored from html.spec.whatwg.org/dev/webappapis.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 10 Sep 2025 08:36:28 GMT -->
<!-- Added by HTTrack --><meta http-equiv="content-type" content="text/html;charset=utf-8" /><!-- /Added by HTTrack -->
<meta charset=utf-8><meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name=viewport><title>HTML Standard, Edition for Web Developers</title><meta content=#3c790a name=theme-color><meta content="light dark" name=color-scheme><link rel=stylesheet href=../../resources.whatwg.org/standard-shared-with-dev.css crossorigin=""><link rel=icon href=https://resources.whatwg.org/logo.svg crossorigin=""><link rel=stylesheet href=styles.css crossorigin=""><script>
   function toggleStatus(div) {
     div.parentNode.classList.toggle('wrapped');
   }
   function setLinkFragment(link) {
     link.hash = location.hash;
   }
  </script><body>
  <script async="" src=search.js></script>
  
  
  <header id=head class="head with-buttons">
   <a href=https://whatwg.org/ class=logo><img width=100 alt=WHATWG crossorigin="" class=darkmode-aware src=https://resources.whatwg.org/logo.svg height=100></a>
   
   <hgroup><h1><a rel=home href=index.html>HTML: The Living Standard</a></h1><p id=dev-edition-h2>Edition for Web Developers — Last Updated <span class=pubdate>10 September 2025</span></hgroup>
   

   <div id=search>
    <input placeholder="Search. Press '/'" autocomplete=off name=query id=query type=search>
    <ol id=results></ol>
   </div>
  </header>

  

  

  

  
  

  
  

  

  <nav><a href=speculative-loading.html>← 7.6 Speculative loading</a> — <a href=index.html>Table of Contents</a> — <a href=dynamic-markup-insertion.html>8.4 Dynamic markup insertion →</a></nav><ol class=toc><li><a href=webappapis.html#webappapis><span class=secno>8</span> Web application APIs</a><ol><li><a href=webappapis.html#scripting><span class=secno>8.1</span> Scripting</a><ol><li><a href=webappapis.html#introduction-10><span class=secno>8.1.1</span> Introduction</a><li><a href=webappapis.html#agents-and-agent-clusters><span class=secno>8.1.2</span> Agents and agent clusters</a><ol><li><a href=webappapis.html#integration-with-the-javascript-agent-formalism><span class=secno>8.1.2.1</span> Integration with the JavaScript agent formalism</a><li><a href=webappapis.html#integration-with-the-javascript-agent-cluster-formalism><span class=secno>8.1.2.2</span> Integration with the JavaScript agent cluster formalism</a></ol><li><a href=webappapis.html#scripting-processing-model><span class=secno>8.1.3</span> Script processing
  model</a><ol><li><a href=webappapis.html#runtime-script-errors><span class=secno>8.1.3.1</span> Runtime script errors</a><li><a href=webappapis.html#unhandled-promise-rejections><span class=secno>8.1.3.2</span> Unhandled promise rejections</a></ol><li><a href=webappapis.html#module-specifier-resolution><span class=secno>8.1.4</span> Module specifier resolution</a><ol><li><a href=webappapis.html#the-resolution-algorithm><span class=secno>8.1.4.1</span> The resolution algorithm</a><li><a href=webappapis.html#import-maps><span class=secno>8.1.4.2</span> Import maps</a><li><a href=webappapis.html#integration-with-the-javascript-module-system><span class=secno>8.1.4.3</span> Module-related host hooks</a></ol><li><a href=webappapis.html#event-loops><span class=secno>8.1.5</span> Event loops</a><li><a href=webappapis.html#events><span class=secno>8.1.6</span> Events</a><ol><li><a href=webappapis.html#event-handler-attributes><span class=secno>8.1.6.1</span> Event handlers</a><li><a href=webappapis.html#event-handlers-on-elements,-document-objects,-and-window-objects><span class=secno>8.1.6.2</span> Event handlers on elements, <code>Document</code> objects, and <code>Window</code> objects</a></ol></ol><li><a href=webappapis.html#windoworworkerglobalscope-mixin><span class=secno>8.2</span> The <code>WindowOrWorkerGlobalScope</code> mixin</a><li><a href=webappapis.html#atob><span class=secno>8.3</span> Base64 utility methods</a></ol></ol><h2 id=webappapis><span class=secno>8</span> Web application APIs<a href=#webappapis class=self-link></a></h2>

  <h3 id=scripting><span class=secno>8.1</span> Scripting<a href=#scripting class=self-link></a></h3>

  <h4 id=introduction-10><span class=secno>8.1.1</span> Introduction<a href=#introduction-10 class=self-link></a></h4>

  <p>Various mechanisms can cause author-provided executable code to run in the context of a
  document. These mechanisms include, but are probably not limited to:</p>

  <ul><li>Processing of <code id=introduction-10:the-script-element><a href=scripting.html#the-script-element>script</a></code> elements.<li>Navigating to <a href=browsing-the-web.html#the-javascript:-url-special-case id=introduction-10:the-javascript:-url-special-case><code>javascript:</code> URLs</a>.<li>Event handlers, whether registered through the DOM using <code>addEventListener()</code>, by explicit <a href=#event-handler-content-attributes id=introduction-10:event-handler-content-attributes>event handler content attributes</a>, by
   <a href=#event-handler-idl-attributes id=introduction-10:event-handler-idl-attributes>event handler IDL attributes</a>, or otherwise.<li>Processing of technologies like SVG that have their own scripting features.</ul>

  <h4 id=agents-and-agent-clusters><span class=secno>8.1.2</span> Agents and agent clusters<a href=#agents-and-agent-clusters class=self-link></a></h4>

  <h5 id=integration-with-the-javascript-agent-formalism><span class=secno>8.1.2.1</span> Integration with the JavaScript agent formalism<a href=#integration-with-the-javascript-agent-formalism class=self-link></a></h5>

  <p>JavaScript defines the concept of an <a id=integration-with-the-javascript-agent-formalism:agent href=https://tc39.es/ecma262/#sec-agents data-x-internal=agent>agent</a>. This section gives the mapping of that
  language-level concept on to the web platform.</p>

  <div class=note>
   <p>Conceptually, the <a id=integration-with-the-javascript-agent-formalism:agent-2 href=https://tc39.es/ecma262/#sec-agents data-x-internal=agent>agent</a> concept is an architecture-independent, idealized
   "thread" in which JavaScript code runs. Such code can involve multiple globals/<span>realms</span> that can synchronously access each other, and
   thus needs to run in a single execution thread.</p>

   
  </div>

  <p>The following types of agents exist on the web platform:</p>

  <dl><dt><dfn id=similar-origin-window-agent data-export="">Similar-origin window agent</dfn><dd>
    <p>Contains various <code>Window</code> objects which can potentially reach each other, either
    directly or by using <code id=integration-with-the-javascript-agent-formalism:dom-document-domain><a href=browsers.html#dom-document-domain>document.domain</a></code>.</p>

    <p>If the encompassing <a id=integration-with-the-javascript-agent-formalism:agent-cluster href=https://tc39.es/ecma262/#sec-agent-clusters data-x-internal=agent-cluster>agent cluster</a>'s <span>is origin-keyed</span> is true, then
    all the <code>Window</code> objects will be <a id=integration-with-the-javascript-agent-formalism:same-origin href=browsers.html#same-origin>same origin</a>, can reach each other
    directly, and <code id=integration-with-the-javascript-agent-formalism:dom-document-domain-2><a href=browsers.html#dom-document-domain>document.domain</a></code> will no-op.</p>

    <p class=note>Two <code>Window</code> objects that are <a id=integration-with-the-javascript-agent-formalism:same-origin-2 href=browsers.html#same-origin>same origin</a> can be in
    different <a href=#similar-origin-window-agent id=integration-with-the-javascript-agent-formalism:similar-origin-window-agent>similar-origin window agents</a>, for
    instance if they are each in their own <a id=integration-with-the-javascript-agent-formalism:browsing-context-group href=document-sequences.html#browsing-context-group>browsing context group</a>.</p>
   <dt><dfn id=dedicated-worker-agent data-export="">Dedicated worker agent</dfn><dd><p>Contains a single <code id=integration-with-the-javascript-agent-formalism:dedicatedworkerglobalscope><a href=workers.html#dedicatedworkerglobalscope>DedicatedWorkerGlobalScope</a></code>.<dt><dfn id=shared-worker-agent data-export="">Shared worker agent</dfn><dd><p>Contains a single <code id=integration-with-the-javascript-agent-formalism:sharedworkerglobalscope><a href=workers.html#sharedworkerglobalscope>SharedWorkerGlobalScope</a></code>.<dt><dfn id=service-worker-agent data-export="">Service worker agent</dfn><dd><p>Contains a single <code id=integration-with-the-javascript-agent-formalism:serviceworkerglobalscope><a data-x-internal=serviceworkerglobalscope href=https://w3c.github.io/ServiceWorker/#serviceworkerglobalscope>ServiceWorkerGlobalScope</a></code>.<dt><dfn id=worklet-agent data-export="">Worklet agent</dfn><dd>
    <p>Contains a single <code id=integration-with-the-javascript-agent-formalism:workletglobalscope><a href=worklets.html#workletglobalscope>WorkletGlobalScope</a></code> object.</p>

    <p class=note>Although a given worklet can have multiple realms, each such realm needs its own
    agent, as each realm can be executing code independently and at the same time as the others.</p>
   </dl>

  <p>Only <a href=#shared-worker-agent id=integration-with-the-javascript-agent-formalism:shared-worker-agent>shared</a> and <a href=#dedicated-worker-agent id=integration-with-the-javascript-agent-formalism:dedicated-worker-agent>dedicated worker agents</a> allow the use of JavaScript <code id=integration-with-the-javascript-agent-formalism:atomics><a data-x-internal=atomics href=https://tc39.es/ecma262/#sec-atomics-object>Atomics</a></code> APIs to
  potentially <a href=https://tc39.es/ecma262/#sec-forward-progress id=integration-with-the-javascript-agent-formalism:forward-progress data-x-internal=forward-progress>block</a>.</p>

  

  <h5 id=integration-with-the-javascript-agent-cluster-formalism><span class=secno>8.1.2.2</span> Integration with the JavaScript agent cluster formalism<a href=#integration-with-the-javascript-agent-cluster-formalism class=self-link></a></h5>

  <p>JavaScript also defines the concept of an <a id=integration-with-the-javascript-agent-cluster-formalism:agent-cluster href=https://tc39.es/ecma262/#sec-agent-clusters data-x-internal=agent-cluster>agent cluster</a>, which this standard maps
  to the web platform by placing agents appropriately when they are created.</p>

  <p>The <a id=integration-with-the-javascript-agent-cluster-formalism:agent-cluster-2 href=https://tc39.es/ecma262/#sec-agent-clusters data-x-internal=agent-cluster>agent cluster</a> concept is crucial for defining the JavaScript memory model, and
  in particular among which <a href=https://tc39.es/ecma262/#sec-agents id=integration-with-the-javascript-agent-cluster-formalism:agent data-x-internal=agent>agents</a> the backing data of
  <code id=integration-with-the-javascript-agent-cluster-formalism:sharedarraybuffer><a data-x-internal=sharedarraybuffer href=https://tc39.es/ecma262/#sec-sharedarraybuffer-objects>SharedArrayBuffer</a></code> objects can be shared.</p>

  <p class=note>Conceptually, the <a id=integration-with-the-javascript-agent-cluster-formalism:agent-cluster-3 href=https://tc39.es/ecma262/#sec-agent-clusters data-x-internal=agent-cluster>agent cluster</a> concept is an
  architecture-independent, idealized "process boundary" that groups together multiple "threads"
  (<a href=https://tc39.es/ecma262/#sec-agents id=integration-with-the-javascript-agent-cluster-formalism:agent-2 data-x-internal=agent>agents</a>). The <a href=https://tc39.es/ecma262/#sec-agent-clusters id=integration-with-the-javascript-agent-cluster-formalism:agent-cluster-4 data-x-internal=agent-cluster>agent clusters</a>
  defined by the specification are generally more restrictive than the actual process boundaries
  implemented in user agents. By enforcing these idealized divisions at the specification level, we
  ensure that web developers see interoperable behavior with regard to shared memory, even in the
  face of varying and changing user agent process models.</p>

  

  <div id=can-share-memory-with class=example><a href=#can-share-memory-with class=self-link></a>
   <p>The following pairs of global objects are each within the same <a id=integration-with-the-javascript-agent-cluster-formalism:agent-cluster-5 href=https://tc39.es/ecma262/#sec-agent-clusters data-x-internal=agent-cluster>agent cluster</a>, and
   thus can use <code id=integration-with-the-javascript-agent-cluster-formalism:sharedarraybuffer-2><a data-x-internal=sharedarraybuffer href=https://tc39.es/ecma262/#sec-sharedarraybuffer-objects>SharedArrayBuffer</a></code> instances to share memory with each other:</p>

   <ul><li><p>A <code>Window</code> object and a dedicated worker that it created.<li><p>A worker (of any type) and a dedicated worker it created.<li><p>A <code>Window</code> object <var>A</var> and the <code>Window</code> object of an
    <code id=integration-with-the-javascript-agent-cluster-formalism:the-iframe-element><a href=iframe-embed-object.html#the-iframe-element>iframe</a></code> element that <var>A</var> created that could be <a id=integration-with-the-javascript-agent-cluster-formalism:same-origin-domain href=browsers.html#same-origin-domain>same
    origin-domain</a> with <var>A</var>.<li><p>A <code>Window</code> object and a <a id=integration-with-the-javascript-agent-cluster-formalism:same-origin-domain-2 href=browsers.html#same-origin-domain>same origin-domain</a> <code>Window</code>
    object that opened it.<li><p>A <code>Window</code> object and a worklet that it created.</ul>

   <p>The following pairs of global objects are <em>not</em> within the same <a id=integration-with-the-javascript-agent-cluster-formalism:agent-cluster-6 href=https://tc39.es/ecma262/#sec-agent-clusters data-x-internal=agent-cluster>agent
   cluster</a>, and thus cannot share memory:</p>

   <ul><li><p>A <code>Window</code> object and a shared worker it created.<li><p>A worker (of any type) and a shared worker it created.<li><p>A <code>Window</code> object and a service worker it created.<li><p>A <code>Window</code> object <var>A</var> and the <code>Window</code> object of an
    <code id=integration-with-the-javascript-agent-cluster-formalism:the-iframe-element-2><a href=iframe-embed-object.html#the-iframe-element>iframe</a></code> element that <var>A</var> created that cannot be <a id=integration-with-the-javascript-agent-cluster-formalism:same-origin-domain-3 href=browsers.html#same-origin-domain>same
    origin-domain</a> with <var>A</var>.<li><p>Any two <code>Window</code> objects with no opener or ancestor relationship. This holds
    even if the two <code>Window</code> objects are <a id=integration-with-the-javascript-agent-cluster-formalism:same-origin href=browsers.html#same-origin>same origin</a>.</ul>
  </div>

  

  <h4 id=scripting-processing-model><span class=secno>8.1.3</span> <span id=processing-model-7></span>Script processing
  model<a href=#scripting-processing-model class=self-link></a></h4>

  

  <h5 id=runtime-script-errors><span class=secno>8.1.3.1</span> Runtime script errors<a href=#runtime-script-errors class=self-link></a></h5><div class="mdn-anno wrapped"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/reportError title="The reportError() global method may be used to report errors to the console or global event handlers, emulating an uncaught JavaScript exception.">reportError</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>93+</span></span><span class="safari yes"><span>Safari</span><span>15.4+</span></span><span class="chrome yes"><span>Chrome</span><span>95+</span></span><hr><span class="opera unknown"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>95+</span></span><hr><span class="edge unknown"><span>Edge (Legacy)</span><span>?</span></span><span class="ie no"><span>Internet Explorer</span><span>No</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios unknown"><span>Safari iOS</span><span>?</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android unknown"><span>WebView Android</span><span>?</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android unknown"><span>Opera Android</span><span>?</span></span></div></div></div>

  <dl class=domintro><dt><code>self.<span id=dom-reporterror>reportError</span>(<var>e</var>)</code><dd><p>Dispatches an <code id=runtime-script-errors:event-error><a href=indices.html#event-error>error</a></code> event at the global object for the
   given value <var>e</var>, in the same fashion as an unhandled exception.</dl>

  <p>In various scenarios, the user agent can report an exception by firing an <code id=runtime-script-errors:event-error-2><a href=indices.html#event-error>error</a></code> event at the <code>Window</code>. If this event is not canceled,
  then the error is considered not handled, and can be reported to the developer console.</p>

  

  <h5 id=unhandled-promise-rejections><span class=secno>8.1.3.2</span> Unhandled promise rejections<a href=#unhandled-promise-rejections class=self-link></a></h5><div class="mdn-anno wrapped"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/Window/rejectionhandled_event title="The rejectionhandled event is sent to the script's global scope (usually window but also Worker) whenever a rejected JavaScript Promise is handled late, i.e. when a handler is attached to the promise after its rejection had caused an unhandledrejection event.">Window/rejectionhandled_event</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>69+</span></span><span class="safari yes"><span>Safari</span><span>11+</span></span><span class="chrome yes"><span>Chrome</span><span>49+</span></span><hr><span class="opera unknown"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge unknown"><span>Edge (Legacy)</span><span>?</span></span><span class="ie no"><span>Internet Explorer</span><span>No</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios yes"><span>Safari iOS</span><span>11.3+</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android unknown"><span>WebView Android</span><span>?</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android unknown"><span>Opera Android</span><span>?</span></span></div></div></div>

  <p>In addition to synchronous <a href=#runtime-script-errors>runtime script errors</a>, scripts
  may experience asynchronous promise rejections, tracked via the <code id=unhandled-promise-rejections:event-unhandledrejection><a href=indices.html#event-unhandledrejection>unhandledrejection</a></code> and <code id=unhandled-promise-rejections:event-rejectionhandled><a href=indices.html#event-rejectionhandled>rejectionhandled</a></code> events.</p>

  


  <h4 id=module-specifier-resolution><span class=secno>8.1.4</span> Module specifier resolution<a href=#module-specifier-resolution class=self-link></a></h4>

  <h5 id=the-resolution-algorithm><span class=secno>8.1.4.1</span> The resolution algorithm<a href=#the-resolution-algorithm class=self-link></a></h5>

  <p>The <span>resolve a module specifier</span> algorithm is the primary entry point for
  converting module specifier strings into <a href=https://url.spec.whatwg.org/#concept-url id=the-resolution-algorithm:url data-x-internal=url>URLs</a>. When no <a href=#import-map id=the-resolution-algorithm:import-map>import maps</a> are involved, it is relatively straightforward, and
  reduces to <span>resolving a URL-like module specifier</span>.</p>

  <p>When there is a non-empty <a href=#import-map id=the-resolution-algorithm:import-map-2>import map</a> present, the behavior is more complex. It
  checks candidate entries from all applicable <span>module specifier
  maps</span>, from most-specific to least-specific <span>scopes</span> (falling back to the top-level unscoped <span>imports</span>), and from most-specific to least-specific
  prefixes. </p>

  

  <p>In the end, if no successful resolution is found via any of the candidate <span>module specifier maps</span>, <span>resolve a module specifier</span> will throw
  an exception. Thus the result is always either a <a id=the-resolution-algorithm:url-2 href=https://url.spec.whatwg.org/#concept-url data-x-internal=url>URL</a> or a thrown exception.</p>

  


  <h5 id=import-maps><span class=secno>8.1.4.2</span> Import maps<a href=#import-maps class=self-link></a></h5>

  <p>An <span id=import-map>import map</span> allows control over module specifier resolution. Import maps
  are delivered via inline <code id=import-maps:the-script-element><a href=scripting.html#the-script-element>script</a></code> elements with their <code id=import-maps:attr-script-type><a href=scripting.html#attr-script-type>type</a></code> attribute set to "<code>importmap</code>", and
  with their <a id=import-maps:child-text-content href=https://dom.spec.whatwg.org/#concept-child-text-content data-x-internal=child-text-content>child text content</a> containing a JSON representation of the import
  map.</p>

  <p>A <code>Document</code> can have multiple import maps processed, which can happen either
  before or after any modules have been imported, e.g., via <code id=import-maps:import()><a data-x-internal=import() href=https://tc39.es/ecma262/#sec-import-calls>import()</a></code> expressions or
  <code id=import-maps:the-script-element-2><a href=scripting.html#the-script-element>script</a></code> elements with their <code id=import-maps:attr-script-type-2><a href=scripting.html#attr-script-type>type</a></code> attribute set
  to "<code>module</code>". The <span>merge existing and new import maps</span> algorithm
  ensures that new import maps cannot define the module resolution for modules that were already
  defined by past import maps, or for ones that were already resolved.</p>

  <div id=example-import-map-bare-specifier class=example><a href=#example-import-map-bare-specifier class=self-link></a>
   <p>The simplest use of import maps is to globally remap a bare module specifier:</p>

   <pre><code class='json'><c- p>{</c->
  <c- u>&quot;imports&quot;</c-><c- o>:</c-> <c- p>{</c->
    <c- u>&quot;moment&quot;</c-><c- o>:</c-> <c- u>&quot;/node_modules/moment/src/moment.js&quot;</c->
  <c- p>}</c->
<c- p>}</c-></code></pre>

   <p>This enables statements like <code class=js>import moment from "moment";</code>
   to work, fetching and evaluating the JavaScript module at the <code>/node_modules/moment/src/moment.js</code> URL.</p>
  </div>

  <div id=example-import-map-trailing-slashes class=example><a href=#example-import-map-trailing-slashes class=self-link></a>
   <p>An import map can remap a class of module specifiers into a class of URLs by using trailing
   slashes, like so:</p>

   <pre><code class='json'><c- p>{</c->
  <c- u>&quot;imports&quot;</c-><c- o>:</c-> <c- p>{</c->
    <c- u>&quot;moment/&quot;</c-><c- o>:</c-> <c- u>&quot;/node_modules/moment/src/&quot;</c->
  <c- p>}</c->
<c- p>}</c-></code></pre>

   <p>This enables statements like <code class=js>import localeData from
   "moment/locale/zh-cn.js";</code> to work, fetching and evaluating the JavaScript module at the
   <code>/node_modules/moment/src/locale/zh-cn.js</code> URL. Such trailing-slash
   mappings are often combined with bare-specifier mappings, e.g.</p>

   <pre><code class='json'><c- p>{</c->
  <c- u>&quot;imports&quot;</c-><c- o>:</c-> <c- p>{</c->
    <c- u>&quot;moment&quot;</c-><c- o>:</c-> <c- u>&quot;/node_modules/moment/src/moment.js&quot;</c-><c- p>,</c->
    <c- u>&quot;moment/&quot;</c-><c- o>:</c-> <c- u>&quot;/node_modules/moment/src/&quot;</c->
  <c- p>}</c->
<c- p>}</c-></code></pre>

   <p>so that both the "main module" specified by "<code>moment</code>" and the
   "submodules" specified by paths such as "<code>moment/locale/zh-cn.js</code>" are
   available.</p>
  </div>

  <div id=example-import-map-url-like-specifier class=example><a href=#example-import-map-url-like-specifier class=self-link></a>
   <p>Bare specifiers are not the only type of module specifiers which import maps can remap.
   "URL-like" specifiers, i.e., those that are either parseable as absolute URLs or start with
   "<code>/</code>", "<code>./</code>", or "<code>../</code>", can be
   remapped as well:</p>

   <pre><code class='json'><c- p>{</c->
  <c- u>&quot;imports&quot;</c-><c- o>:</c-> <c- p>{</c->
    <c- u>&quot;https://cdn.example.com/vue/dist/vue.runtime.esm.js&quot;</c-><c- o>:</c-> <c- u>&quot;/node_modules/vue/dist/vue.runtime.esm.js&quot;</c-><c- p>,</c->
    <c- u>&quot;/js/app.mjs&quot;</c-><c- o>:</c-> <c- u>&quot;/js/app-8e0d62a03.mjs&quot;</c-><c- p>,</c->
    <c- u>&quot;../helpers/&quot;</c-><c- o>:</c-> <c- u>&quot;https://cdn.example/helpers/&quot;</c->
  <c- p>}</c->
<c- p>}</c-></code></pre>

   <p>Note how the URL to be remapped, as well as the URL being mapped to, can be specified either
   as absolute URLs, or as relative URLs starting with "<code>/</code>", "<code>./</code>", or "<code>../</code>". (They cannot be specified as relative
   URLs without those starting sigils, as those help distinguish from bare module specifiers.) Also
   note how the <a href=#example-import-map-trailing-slashes>trailing slash mapping</a> works in
   this context as well.</p>

   <p>Such remappings operate on the post-canonicalization URL, and do not require a match between
   the literal strings supplied in the import map key and the imported module specifier. So for
   example, if this import map was included on <code>https://example.com/app.html</code>,
   then not only would <code class=js>import "/js/app.mjs"</code> be remapped, but so
   would <code class=js>import "./js/app.mjs"</code> and <code class=js>import "./foo/../js/app.mjs"</code>.</p>
  </div>

  <div id=example-import-map-scopes class=example><a href=#example-import-map-scopes class=self-link></a>
   <p>All previous examples have globally remapped module specifiers, by using the top-level "<code>imports</code>" key in the import map. The top-level "<code>scopes</code>"
   key can be used to provide localized remappings, which only apply when the referring module
   matches a specific URL prefix. For example:</p>

   <pre><code class='json'><c- p>{</c->
  <c- u>&quot;scopes&quot;</c-><c- o>:</c-> <c- p>{</c->
    <c- u>&quot;/a/&quot;</c-> <c- o>:</c-> <c- p>{</c->
      <c- u>&quot;moment&quot;</c-><c- o>:</c-> <c- u>&quot;/node_modules/moment/src/moment.js&quot;</c->
    <c- p>},</c->
    <c- u>&quot;/b/&quot;</c-> <c- o>:</c-> <c- p>{</c->
      <c- u>&quot;moment&quot;</c-><c- o>:</c-> <c- u>&quot;https://cdn.example.com/moment/src/moment.js&quot;</c->
    <c- p>}</c->
  <c- p>}</c->
<c- p>}</c-></code></pre>

   <p>With this import map, the statement <code>import "moment"</code> will have
   different meanings depending on which referrer script contains the statement:</p>

   <ul><li><p>Inside scripts located under <code>/a/</code>, this will import <code>/node_modules/moment/src/moment.js</code>.<li><p>Inside scripts located under <code>/b/</code>, this will import <code>https://cdn.example.com/moment/src/moment.js</code>.<li><p>Inside scripts located under <code>/c/</code>, this will fail to resolve and
    thus throw an exception.</ul>

   <p>A typical usage of scopes is to allow multiple versions of the "same" module to exist in a
   web application, with some parts of the module graph importing one version, and other parts
   importing another version.
  </div>

  <div id=example-import-map-scopes-overlapping class=example><a href=#example-import-map-scopes-overlapping class=self-link></a>
   <p>Scopes can overlap each other, and overlap the global "<code>imports</code>"
   specifier map. At resolution time, scopes are consulted in order of most- to least-specific,
   where specificity is measured by sorting the scopes using the <a id=import-maps:code-unit-less-than href=https://infra.spec.whatwg.org/#code-unit-less-than data-x-internal=code-unit-less-than>code unit less than</a>
   operation. So, for example, "<code>/scope2/scope3/</code>" is treated as more specific
   than "<code>/scope2/</code>", which is treated as more specific than the top-level
   (unscoped) mappings.</p>

   <p>The following import map illustrates this:</p>

   <pre><code class='json'><c- p>{</c->
  <c- u>&quot;imports&quot;</c-><c- o>:</c-> <c- p>{</c->
    <c- u>&quot;a&quot;</c-><c- o>:</c-> <c- u>&quot;/a-1.mjs&quot;</c-><c- p>,</c->
    <c- u>&quot;b&quot;</c-><c- o>:</c-> <c- u>&quot;/b-1.mjs&quot;</c-><c- p>,</c->
    <c- u>&quot;c&quot;</c-><c- o>:</c-> <c- u>&quot;/c-1.mjs&quot;</c->
  <c- p>},</c->
  <c- u>&quot;scopes&quot;</c-><c- o>:</c-> <c- p>{</c->
    <c- u>&quot;/scope2/&quot;</c-><c- o>:</c-> <c- p>{</c->
      <c- u>&quot;a&quot;</c-><c- o>:</c-> <c- u>&quot;/a-2.mjs&quot;</c->
    <c- p>},</c->
    <c- u>&quot;/scope2/scope3/&quot;</c-><c- o>:</c-> <c- p>{</c->
      <c- u>&quot;b&quot;</c-><c- o>:</c-> <c- u>&quot;/b-3.mjs&quot;</c->
    <c- p>}</c->
  <c- p>}</c->
<c- p>}</c-></code></pre>

   <p>This results in the following resolutions (using relative URLs for brevity):</p>

   <table id=table-import-map-scopes-example><thead><tr><td colspan=2 rowspan=2>
      <th colspan=3>Specifier
     <tr><th>"<code>a</code>"
      <th>"<code>b</code>"
      <th>"<code>c</code>"
    <tbody><tr><th rowspan=3>Referrer
      <th><code>/scope1/r.mjs</code>
      <td><code>/a-1.mjs</code>
      <td><code>/b-1.mjs</code>
      <td><code>/c-1.mjs</code>
     <tr><th><code>/scope2/r.mjs</code>
      <td><code>/a-2.mjs</code>
      <td><code>/b-1.mjs</code>
      <td><code>/c-1.mjs</code>
     <tr><th><code>/scope2/scope3/r.mjs</code>
      <td><code>/a-2.mjs</code>
      <td><code>/b-3.mjs</code>
      <td><code>/c-1.mjs</code>
   </table>
  </div>

  <div id=example-import-map-integrity class=example><a href=#example-import-map-integrity class=self-link></a>
   <p>Import maps can also be used to provide modules with integrity metadata to be used in
   <cite>Subresource Integrity</cite> checks. <a href=references.html#refsSRI>[SRI]</a>
   </p>

   <p>The following import map illustrates this:</p>

   <pre><code class='json'><c- p>{</c->
  <c- u>&quot;imports&quot;</c-><c- o>:</c-> <c- p>{</c->
    <c- u>&quot;a&quot;</c-><c- o>:</c-> <c- u>&quot;/a-1.mjs&quot;</c-><c- p>,</c->
    <c- u>&quot;b&quot;</c-><c- o>:</c-> <c- u>&quot;/b-1.mjs&quot;</c-><c- p>,</c->
    <c- u>&quot;c&quot;</c-><c- o>:</c-> <c- u>&quot;/c-1.mjs&quot;</c->
  <c- p>},</c->
  <c- u>&quot;integrity&quot;</c-><c- o>:</c-> <c- p>{</c->
    <c- u>&quot;/a-1.mjs&quot;</c-><c- o>:</c-> <c- u>&quot;sha384-Li9vy3DqF8tnTXuiaAJuML3ky+er10rcgNR/VqsVpcw+ThHmYcwiB1pbOxEbzJr7&quot;</c-><c- p>,</c->
    <c- u>&quot;/d-1.mjs&quot;</c-><c- o>:</c-> <c- u>&quot;sha384-MBO5IDfYaE6c6Aao94oZrIOiC6CGiSN2n4QUbHNPhzk5Xhm0djZLQqTpL0HzTUxk&quot;</c->
  <c- p>}</c->
<c- p>}</c-></code></pre>
   <p>The above example provides integrity metadata to be enforced on the modules <code>/a-1.mjs</code> and <code>/d-1.mjs</code>, even if the latter is not defined
   as an import in the map.</p>
  </div>

  <hr>

  <p>The <a id=import-maps:child-text-content-2 href=https://dom.spec.whatwg.org/#concept-child-text-content data-x-internal=child-text-content>child text content</a> of a <code id=import-maps:the-script-element-3><a href=scripting.html#the-script-element>script</a></code> element representing an
  <a href=#import-map id=import-maps:import-map>import map</a> must match the following <dfn id=import-map-authoring-requirements>import map authoring
  requirements</dfn>:</p>

  <ul><li><p>It must be valid JSON. <a href=references.html#refsJSON>[JSON]</a><li><p>The JSON must represent a JSON object, with at most the three keys "<code>imports</code>", "<code>scopes</code>", and "<code>integrity</code>".<li><p>The values corresponding to the "<code>imports</code>", "<code>scopes</code>", and "<code>integrity</code>" keys, if present,
   must themselves be JSON objects.<li><p>The value corresponding to the "<code>imports</code>" key, if present, must be
   a <a href=#valid-module-specifier-map id=import-maps:valid-module-specifier-map>valid module specifier map</a>.<li><p>The value corresponding to the "<code>scopes</code>" key, if present, must be a
   JSON object, whose keys are <a href=https://url.spec.whatwg.org/#valid-url-string id=import-maps:valid-url-string data-x-internal=valid-url-string>valid URL strings</a> and whose
   values are <a href=#valid-module-specifier-map id=import-maps:valid-module-specifier-map-2>valid module specifier
   maps</a>.<li><p>The value corresponding to the "<code>integrity</code>" key, if present, must
   be a JSON object, whose keys are <a href=https://url.spec.whatwg.org/#valid-url-string id=import-maps:valid-url-string-2 data-x-internal=valid-url-string>valid URL strings</a> and
   whose values fit <a id=import-maps:the-requirements-of-the-integrity-attribute href=https://w3c.github.io/webappsec-subresource-integrity/#the-integrity-attribute data-x-internal=the-requirements-of-the-integrity-attribute>the requirements of the integrity attribute</a>.</ul>

  <p>A <dfn id=valid-module-specifier-map>valid module specifier map</dfn> is a JSON object that meets the following
  requirements:</p>

  <ul><li><p>All of its keys must be nonempty.<li><p>All of its values must be strings.<li><p>Each value must be either a <a href=https://url.spec.whatwg.org/#syntax-url-absolute id=import-maps:absolute-url data-x-internal=absolute-url>valid absolute URL</a> or a
   <a id=import-maps:valid-url-string-3 href=https://url.spec.whatwg.org/#valid-url-string data-x-internal=valid-url-string>valid URL string</a> that <a id=import-maps:starts-with href=https://infra.spec.whatwg.org/#string-starts-with data-x-internal=starts-with>starts with</a> "<code>/</code>", "<code>./</code>", or "<code>../</code>".<li><p>If a given key <a id=import-maps:ends-with href=https://infra.spec.whatwg.org/#string-ends-with data-x-internal=ends-with>ends with</a> "<code>/</code>", then the corresponding
   value must also.</ul>


  


  <h5 id=integration-with-the-javascript-module-system><span class=secno>8.1.4.3</span> Module-related host hooks<a href=#integration-with-the-javascript-module-system class=self-link></a></h5>

  <p>The JavaScript specification defines a syntax for modules, as well as some host-agnostic parts
  of their processing model. This specification defines the rest of their processing model: how the
  module system is bootstrapped, via the <code id=integration-with-the-javascript-module-system:the-script-element><a href=scripting.html#the-script-element>script</a></code> element with <code id=integration-with-the-javascript-module-system:attr-script-type><a href=scripting.html#attr-script-type>type</a></code> attribute set to "<code>module</code>", and how
  modules are fetched, resolved, and executed. <a href=references.html#refsJAVASCRIPT>[JAVASCRIPT]</a></p>

  <p class=note>Although the JavaScript specification speaks in terms of "scripts" versus
  "modules", in general this specification speaks in terms of <span>classic
  scripts</span> versus <span>module scripts</span>, since both of them use
  the <code id=integration-with-the-javascript-module-system:the-script-element-2><a href=scripting.html#the-script-element>script</a></code> element.</p>

  <dl class=domintro><dt><code><var>modulePromise</var> = <a href=https://tc39.es/ecma262/#sec-import-calls id=integration-with-the-javascript-module-system:import() data-x-internal=import()>import(<var>specifier</var>)</a></code><dd>
    <p>Returns a promise for the module namespace object for the <span>module script</span>
    identified by <var>specifier</var>. This allows dynamic importing of module scripts at runtime,
    instead of statically using the <code>import</code> statement form. The specifier will
    be <span>resolved</span> relative to the <span>active
    script</span>.</p>

    <p>The returned promise will be rejected if an invalid specifier is given, or if a failure is
    encountered while <span>fetching</span> or evaluating the
    resulting module graph.</p>

    <p>This syntax can be used inside both <span>classic</span> and <span>module scripts</span>. It thus provides a bridge into the module-script
    world, from the classic-script world.</p>
   <dt><code><var>url</var> = <a href=https://tc39.es/ecma262/#sec-meta-properties id=integration-with-the-javascript-module-system:import.meta data-x-internal=import.meta>import.meta</a>.<span>url</span></code><dd>
    <p>Returns the <span>active module script</span>'s <span>base URL</span>.</p>

    <p>This syntax can only be used inside <span>module scripts</span>.</p>
   <dt><code><var>url</var> = <a href=https://tc39.es/ecma262/#sec-meta-properties id=integration-with-the-javascript-module-system:import.meta-2 data-x-internal=import.meta>import.meta</a>.<span>resolve</span>(<var>specifier</var>)</code><dd>
    <p>Returns <var>specifier</var>, <span>resolved</span>
    relative to the <span>active script</span>. That is, this returns the URL that would be imported
    by using <code id=integration-with-the-javascript-module-system:import()-2><a data-x-internal=import() href=https://tc39.es/ecma262/#sec-import-calls>import(<var>specifier</var>)</a></code>.</p>

    <p>Throws a <code id=integration-with-the-javascript-module-system:typeerror><a data-x-internal=typeerror href=https://tc39.es/ecma262/#sec-native-error-types-used-in-this-standard-typeerror>TypeError</a></code> exception if an invalid specifier is given.</p>

    <p>This syntax can only be used inside <span>module scripts</span>.</p>
   </dl>

  <p><span>Module maps</span> are used to ensure
  that imported module scripts are only fetched, parsed, and evaluated once per
  <code>Document</code> or <a href=workers.html#workers>worker</a>.</p>

  <div class=example>
   <p>Since <span>module maps</span> are keyed by (URL, module type), the
   following code will create three separate entries in the <span>module map</span>, since it
   results in three different (URL, module type) <a href=https://infra.spec.whatwg.org/#tuple id=integration-with-the-javascript-module-system:tuple data-x-internal=tuple>tuples</a> (all with "<code>javascript-or-wasm</code>" type):</p>

   <pre><code class='js'><c- k>import</c-> <c- u>&quot;https://example.com/module.mjs&quot;</c-><c- p>;</c->
<c- k>import</c-> <c- u>&quot;https://example.com/module.mjs#map-buster&quot;</c-><c- p>;</c->
<c- k>import</c-> <c- u>&quot;https://example.com/module.mjs?debug=true&quot;</c-><c- p>;</c-></code></pre>

   <p>That is, URL <a href=https://url.spec.whatwg.org/#concept-url-query id=integration-with-the-javascript-module-system:concept-url-query data-x-internal=concept-url-query>queries</a> and <a href=https://url.spec.whatwg.org/#concept-url-fragment id=integration-with-the-javascript-module-system:concept-url-fragment data-x-internal=concept-url-fragment>fragments</a> can be varied to create distinct entries in the
   <span>module map</span>; they are not ignored. Thus, three separate fetches and three separate
   module evaluations will be performed.</p>

   <p>In contrast, the following code would only create a single entry in the <span>module
   map</span>, since after applying the <a id=integration-with-the-javascript-module-system:url-parser href=https://url.spec.whatwg.org/#concept-url-parser data-x-internal=url-parser>URL parser</a> to these inputs, the resulting <a href=https://url.spec.whatwg.org/#concept-url id=integration-with-the-javascript-module-system:url-record data-x-internal=url-record>URL records</a> are equal:</p>

   <pre><code class='js'><c- k>import</c-> <c- u>&quot;https://example.com/module2.mjs&quot;</c-><c- p>;</c->
<c- k>import</c-> <c- u>&quot;https:example.com/module2.mjs&quot;</c-><c- p>;</c->
<c- k>import</c-> <c- u>&quot;https://///example.com\\module2.mjs&quot;</c-><c- p>;</c->
<c- k>import</c-> <c- u>&quot;https://example.com/foo/../module2.mjs&quot;</c-><c- p>;</c-></code></pre>

   <p>So in this second example, only one fetch and one module evaluation will occur.</p>

   <p>Note that this behavior is the same as how <a href=workers.html#sharedworker id=integration-with-the-javascript-module-system:sharedworker>shared workers</a> are keyed by their parsed <span>constructor URL</span>.</p>
  </div>

  <div class=example>
   <p>Since module type is also part of the <span>module map</span> key, the following code will
   create two separate entries in the <span>module map</span> (the type is "<code>javascript-or-wasm</code>" for the first, and "<code>css</code>" for the
   second):</p>

   <pre><code class='html'><c- p>&lt;</c-><c- f>script</c-> <c- e>type</c-><c- o>=</c-><c- s>module</c-><c- p>&gt;</c->
  <c- k>import</c-> <c- u>&quot;https://example.com/module&quot;</c-><c- p>;</c->
<c- p>&lt;/</c-><c- f>script</c-><c- p>&gt;</c->
<c- p>&lt;</c-><c- f>script</c-> <c- e>type</c-><c- o>=</c-><c- s>module</c-><c- p>&gt;</c->
  <c- k>import</c-> <c- u>&quot;https://example.com/module&quot;</c-> <c- a>with</c-> <c- p>{</c-> type<c- o>:</c-> <c- u>&quot;css&quot;</c-> <c- p>};</c->
<c- p>&lt;/</c-><c- f>script</c-><c- p>&gt;</c-></code></pre>

   <p>This can result in two separate fetches and two separate module evaluations being performed.</p>

   <p class=XXX>In practice, due to the as-yet-unspecified memory cache (see issue <a href=https://github.com/whatwg/html/issues/6110>#6110</a>) the resource may only be fetched
   once in WebKit and Blink-based browsers. Additionally, as long as all module types are mutually
   exclusive, the module type check in <span>fetch a single module script</span> will fail for at
   least one of the imports, so at most one module evaluation will occur.</p>

   <p>The purpose of including the type in the <span>module map</span> key is so that an import
   with the wrong type attribute does not prevent a different import of the same specifier but with
   the correct type from succeeding.</p>
  </div>

  <div class=example>
   <p>JavaScript module scripts are the default import type when importing from another JavaScript
    module; that is, when an <code>import</code> statement lacks a <code>type</code> import attribute the imported module script's type will be JavaScript.
    Attempting to import a JavaScript resource using an <code>import</code> statement with
    a <code>type</code> import attribute will fail:</p>

    <pre><code class='html'><c- p>&lt;</c-><c- f>script</c-> <c- e>type</c-><c- o>=</c-><c- s>&quot;module&quot;</c-><c- p>&gt;</c->
    <c- c1>// All of the following will fail, assuming that the imported .mjs files are served with a</c->
    <c- c1>// JavaScript MIME type. JavaScript module scripts are the default and cannot be imported with</c->
    <c- c1>// any import type attribute.</c->
    <c- k>import</c-> foo <c- k>from</c-> <c- u>&quot;./foo.mjs&quot;</c-> <c- a>with</c-> <c- p>{</c-> type<c- o>:</c-> <c- u>&quot;javascript&quot;</c-> <c- p>};</c->
    <c- k>import</c-> foo2 <c- k>from</c-> <c- u>&quot;./foo2.mjs&quot;</c-> <c- a>with</c-> <c- p>{</c-> type<c- o>:</c-> <c- u>&quot;js&quot;</c-> <c- p>};</c->
    <c- k>import</c-> foo3 <c- k>from</c-> <c- u>&quot;./foo3.mjs&quot;</c-> <c- a>with</c-> <c- p>{</c-> type<c- o>:</c-> <c- u>&quot;&quot;</c-> <c- p>};</c->
    <c- k>await</c-> <c- k>import</c-><c- p>(</c-><c- u>&quot;./foo4.mjs&quot;</c-><c- p>,</c-> <c- p>{</c-> <c- a>with</c-><c- o>:</c-> <c- p>{</c-> type<c- o>:</c-> <c- kc>null</c-> <c- p>}</c-> <c- p>});</c->
    <c- k>await</c-> <c- k>import</c-><c- p>(</c-><c- u>&quot;./foo5.mjs&quot;</c-><c- p>,</c-> <c- p>{</c-> <c- a>with</c-><c- o>:</c-> <c- p>{</c-> type<c- o>:</c-> <c- kc>undefined</c-> <c- p>}</c-> <c- p>});</c->
<c- p>&lt;/</c-><c- f>script</c-><c- p>&gt;</c-></code></pre>
  </div>

  

  <h4 id=event-loops><span class=secno>8.1.5</span> Event loops<a href=#event-loops class=self-link></a></h4>

  

  <p>To coordinate events, user interaction, scripts, rendering, networking, and so forth, user
  agents must use <dfn id=event-loop data-lt="event loop" data-export="">event loops</dfn> as
  described in this section. Each <a id=event-loops:agent href=https://tc39.es/ecma262/#sec-agents data-x-internal=agent>agent</a> has an associated <dfn data-dfn-for=agent id=concept-agent-event-loop data-export="">event loop</dfn>, which is unique to that agent.</p>

  <p>The <a href=#concept-agent-event-loop id=event-loops:concept-agent-event-loop>event loop</a> of a <a href=#similar-origin-window-agent id=event-loops:similar-origin-window-agent>similar-origin window
  agent</a> is known as a <dfn id=window-event-loop>window event loop</dfn>. The <a href=#concept-agent-event-loop id=event-loops:concept-agent-event-loop-2>event loop</a> of a <a href=#dedicated-worker-agent id=event-loops:dedicated-worker-agent>dedicated worker agent</a>,
  <a href=#shared-worker-agent id=event-loops:shared-worker-agent>shared worker agent</a>, or <a href=#service-worker-agent id=event-loops:service-worker-agent>service worker agent</a> is known as a <dfn id=worker-event-loop-2>worker
  event loop</dfn>. And the <a href=#concept-agent-event-loop id=event-loops:concept-agent-event-loop-3>event loop</a> of a
  <a href=#worklet-agent id=event-loops:worklet-agent>worklet agent</a> is known as a <dfn id=worklet-event-loop>worklet event loop</dfn>.</p>

  <div class=note>
   <p><a href=#event-loop id=event-loops:event-loop>Event loops</a> do not necessarily correspond to implementation
   threads. For example, multiple <a href=#window-event-loop id=event-loops:window-event-loop>window event loops</a> could
   be cooperatively scheduled in a single thread.</p>

   <p>However, for the various worker <a href=https://tc39.es/ecma262/#sec-agents id=event-loops:agent-2 data-x-internal=agent>agents</a> that are allocated with
   [[CanBlock]] set to true, the JavaScript specification does place requirements on them regarding
   <a id=event-loops:forward-progress href=https://tc39.es/ecma262/#sec-forward-progress data-x-internal=forward-progress>forward progress</a>, which effectively amount to requiring dedicated per-agent threads
   in those cases.</p>
  </div>

  

  <h4 id=events><span class=secno>8.1.6</span> Events<a href=#events class=self-link></a></h4>

  <h5 id=event-handler-attributes><span class=secno>8.1.6.1</span> Event handlers<a href=#event-handler-attributes class=self-link></a></h5><div class="mdn-anno wrapped"><button onclick=toggleStatus(this) class=mdn-anno-btn><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/Guide/Events/Event_handlers title="Events are signals fired inside the browser window that notify of changes in the browser or operating system environment. Programmers can create event handler code that will run when an event fires, allowing web pages to respond appropriately to change.">Events/Event_handlers</a></div></div>

  <p>Many objects can have <dfn id=event-handlers data-lt="event handler" data-export="">event handlers</dfn> specified. These
  act as non-capture <a href=https://dom.spec.whatwg.org/#concept-event-listener id=event-handler-attributes:event-listener data-x-internal=event-listener>event listeners</a> for the object on which
  they are specified. <a href=references.html#refsDOM>[DOM]</a></p>

  

  <p>Event handlers are exposed in two ways.</p>

  <p>The first way, common to all event handlers, is as an <a href=#event-handler-idl-attributes id=event-handler-attributes:event-handler-idl-attributes>event handler IDL attribute</a>.</p>

  <p>The second way is as an <a href=#event-handler-content-attributes id=event-handler-attributes:event-handler-content-attributes>event handler content
  attribute</a>. Event handlers on <a id=event-handler-attributes:html-elements href=infrastructure.html#html-elements>HTML elements</a> and some of the event handlers on
  <code>Window</code> objects are exposed in this way.</p>

  <p>For both of these two ways, the <a href=#event-handlers id=event-handler-attributes:event-handlers>event handler</a> is exposed
  through a <dfn id=event-handler-name>name</dfn>, which is a string that always starts with
  "<code>on</code>" and is followed by the name of the event for which the handler is
  intended.</p>

  <hr>

  <p>Most of the time, the object that exposes an <a href=#event-handlers id=event-handler-attributes:event-handlers-2>event handler</a>
  is the same as the object on which the corresponding <a id=event-handler-attributes:event-listener-2 href=https://dom.spec.whatwg.org/#concept-event-listener data-x-internal=event-listener>event listener</a> is added.
  However, the <code id=event-handler-attributes:the-body-element><a href=sections.html#the-body-element>body</a></code> and <code>frameset</code> elements expose several <a href=#event-handlers id=event-handler-attributes:event-handlers-3>event
  handlers</a> that act upon the element's <code>Window</code> object, if one exists. In either
  case, we call the object an <a href=#event-handlers id=event-handler-attributes:event-handlers-4>event handler</a> acts upon the <dfn id=event-handler-target>target</dfn> of that <a href=#event-handlers id=event-handler-attributes:event-handlers-5>event
  handler</a>.</p>

  

  <hr>

  <p>An <dfn id=event-handler-idl-attributes data-export="">event handler IDL attribute</dfn> is an
  IDL attribute for a specific <a href=#event-handlers id=event-handler-attributes:event-handlers-6>event handler</a>. The name of the
  IDL attribute is the same as the <a href=#event-handler-name id=event-handler-attributes:event-handler-name>name</a> of the <a href=#event-handlers id=event-handler-attributes:event-handlers-7>event handler</a>.</p>

  

  <hr>

  <p>An <dfn id=event-handler-content-attributes data-export="">event handler content attribute</dfn>
  is a content attribute for a specific <a href=#event-handlers id=event-handler-attributes:event-handlers-8>event handler</a>. The name
  of the content attribute is the same as the <a href=#event-handler-name id=event-handler-attributes:event-handler-name-2>name</a> of the
  <a href=#event-handlers id=event-handler-attributes:event-handlers-9>event handler</a>.</p>

  <p><a href=#event-handler-content-attributes id=event-handler-attributes:event-handler-content-attributes-2>Event handler content attributes</a>, when specified, must contain valid JavaScript
  code which, when parsed, would match the <i id=event-handler-attributes:js-prod-functionbody><a data-x-internal=js-prod-functionbody href=https://tc39.es/ecma262/#prod-FunctionBody>FunctionBody</a></i>
  production after <a id=event-handler-attributes:automatic-semicolon-insertion href=https://tc39.es/ecma262/#sec-automatic-semicolon-insertion data-x-internal=automatic-semicolon-insertion>automatic semicolon insertion</a>.</p>

  

  <div class=example>

   <p>This example demonstrates the order in which event listeners are invoked. If the button in
   this example is clicked by the user, the page will show four alerts, with the text "ONE", "TWO",
   "THREE", and "FOUR" respectively.</p>

   <pre><code class='html'><c- p>&lt;</c-><c- f>button</c-> <c- e>id</c-><c- o>=</c-><c- s>&quot;test&quot;</c-><c- p>&gt;</c->Start Demo<c- p>&lt;/</c-><c- f>button</c-><c- p>&gt;</c->
<c- p>&lt;</c-><c- f>script</c-><c- p>&gt;</c->
 <c- a>var</c-> button <c- o>=</c-> document<c- p>.</c->getElementById<c- p>(</c-><c- t>&apos;test&apos;</c-><c- p>);</c->
 button<c- p>.</c->addEventListener<c- p>(</c-><c- t>&apos;click&apos;</c-><c- p>,</c-> <c- a>function</c-> <c- p>()</c-> <c- p>{</c-> alert<c- p>(</c-><c- t>&apos;ONE&apos;</c-><c- p>)</c-> <c- p>},</c-> <c- kc>false</c-><c- p>);</c->
 button<c- p>.</c->setAttribute<c- p>(</c-><c- t>&apos;onclick&apos;</c-><c- p>,</c-> <c- u>&quot;alert(&apos;NOT CALLED&apos;)&quot;</c-><c- p>);</c-> <c- c1>// event handler listener is registered here</c->
 button<c- p>.</c->addEventListener<c- p>(</c-><c- t>&apos;click&apos;</c-><c- p>,</c-> <c- a>function</c-> <c- p>()</c-> <c- p>{</c-> alert<c- p>(</c-><c- t>&apos;THREE&apos;</c-><c- p>)</c-> <c- p>},</c-> <c- kc>false</c-><c- p>);</c->
 button<c- p>.</c->onclick <c- o>=</c-> <c- a>function</c-> <c- p>()</c-> <c- p>{</c-> alert<c- p>(</c-><c- t>&apos;TWO&apos;</c-><c- p>);</c-> <c- p>};</c->
 button<c- p>.</c->addEventListener<c- p>(</c-><c- t>&apos;click&apos;</c-><c- p>,</c-> <c- a>function</c-> <c- p>()</c-> <c- p>{</c-> alert<c- p>(</c-><c- t>&apos;FOUR&apos;</c-><c- p>)</c-> <c- p>},</c-> <c- kc>false</c-><c- p>);</c->
<c- p>&lt;/</c-><c- f>script</c-><c- p>&gt;</c-></code></pre>

   <p>However, in the following example, the event handler is <span>deactivated</span> after its initial activation (and its event listener is removed),
   before being reactivated at a later time. The page will show five alerts with "ONE", "TWO",
   "THREE", "FOUR", and "FIVE" respectively, in order.</p>

   <pre><code class='html'><c- p>&lt;</c-><c- f>button</c-> <c- e>id</c-><c- o>=</c-><c- s>&quot;test&quot;</c-><c- p>&gt;</c->Start Demo<c- p>&lt;/</c-><c- f>button</c-><c- p>&gt;</c->
<c- p>&lt;</c-><c- f>script</c-><c- p>&gt;</c->
 <c- a>var</c-> button <c- o>=</c-> document<c- p>.</c->getElementById<c- p>(</c-><c- t>&apos;test&apos;</c-><c- p>);</c->
 button<c- p>.</c->addEventListener<c- p>(</c-><c- t>&apos;click&apos;</c-><c- p>,</c-> <c- a>function</c-> <c- p>()</c-> <c- p>{</c-> alert<c- p>(</c-><c- t>&apos;ONE&apos;</c-><c- p>)</c-> <c- p>},</c-> <c- kc>false</c-><c- p>);</c->
 button<c- p>.</c->setAttribute<c- p>(</c-><c- t>&apos;onclick&apos;</c-><c- p>,</c-> <c- u>&quot;alert(&apos;NOT CALLED&apos;)&quot;</c-><c- p>);</c-> <c- c1>// event handler is activated here</c->
 button<c- p>.</c->addEventListener<c- p>(</c-><c- t>&apos;click&apos;</c-><c- p>,</c-> <c- a>function</c-> <c- p>()</c-> <c- p>{</c-> alert<c- p>(</c-><c- t>&apos;TWO&apos;</c-><c- p>)</c-> <c- p>},</c-> <c- kc>false</c-><c- p>);</c->
 button<c- p>.</c->onclick <c- o>=</c-> <c- kc>null</c-><c- p>;</c->                                 <c- c1>// but deactivated here</c->
 button<c- p>.</c->addEventListener<c- p>(</c-><c- t>&apos;click&apos;</c-><c- p>,</c-> <c- a>function</c-> <c- p>()</c-> <c- p>{</c-> alert<c- p>(</c-><c- t>&apos;THREE&apos;</c-><c- p>)</c-> <c- p>},</c-> <c- kc>false</c-><c- p>);</c->
 button<c- p>.</c->onclick <c- o>=</c-> <c- a>function</c-> <c- p>()</c-> <c- p>{</c-> alert<c- p>(</c-><c- t>&apos;FOUR&apos;</c-><c- p>);</c-> <c- p>};</c->       <c- c1>// and re-activated here</c->
 button<c- p>.</c->addEventListener<c- p>(</c-><c- t>&apos;click&apos;</c-><c- p>,</c-> <c- a>function</c-> <c- p>()</c-> <c- p>{</c-> alert<c- p>(</c-><c- t>&apos;FIVE&apos;</c-><c- p>)</c-> <c- p>},</c-> <c- kc>false</c-><c- p>);</c->
<c- p>&lt;/</c-><c- f>script</c-><c- p>&gt;</c-></code></pre>

  </div>

  

  <hr>

  <p>The <code>EventHandler</code> callback function type represents a callback used for event
  handlers.</p>

  

  <p class=note>In JavaScript, any <code id=event-handler-attributes:idl-function><a data-x-internal=idl-function href=https://webidl.spec.whatwg.org/#common-Function>Function</a></code> object implements
  this interface.</p>

  <div class=example>

   <p>For example, the following document fragment:</p>

   <pre><code class='html'><c- p>&lt;</c-><c- f>body</c-> <c- e>onload</c-><c- o>=</c-><c- s>&quot;alert(this)&quot;</c-> <c- e>onclick</c-><c- o>=</c-><c- s>&quot;alert(this)&quot;</c-><c- p>&gt;</c-></code></pre>

   <p>...leads to an alert saying "<code>[object Window]</code>" when the document is
   loaded, and an alert saying "<code>[object HTMLBodyElement]</code>" whenever the
   user clicks something in the page.</p>

  </div>

  <div class=note>
   <p>The return value of the function affects whether the event is canceled or not: if the return value is false, the event is canceled.</p>

   <p>There are two exceptions in the platform, for historical reasons:</p>

   <ul><li><p>The <code id=event-handler-attributes:handler-onerror><a href=#handler-onerror>onerror</a></code> handlers on global objects, where
    returning <em>true</em> cancels the event.<li><p>The <code id=event-handler-attributes:handler-window-onbeforeunload><a href=#handler-window-onbeforeunload>onbeforeunload</a></code> handler, where
    returning any non-null and non-undefined value will cancel the event.</ul>
  </div>

  <p>For historical reasons, the <code id=event-handler-attributes:handler-onerror-2><a href=#handler-onerror>onerror</a></code> handler has different
  arguments:</p>

  

  <div class=example>
   <pre><code class='js'>window<c- p>.</c->onerror <c- o>=</c-> <c- p>(</c->message<c- p>,</c-> source<c- p>,</c-> lineno<c- p>,</c-> colno<c- p>,</c-> error<c- p>)</c-> <c- p>=&gt;</c-> <c- p>{</c-> … <c- p>};</c-></code></pre>
  </div>

  <p>Similarly, the <code id=event-handler-attributes:handler-window-onbeforeunload-2><a href=#handler-window-onbeforeunload>onbeforeunload</a></code> handler has a
  different return value:<span> it will be cast to a string.</span></p>

  

  

  



  <h5 id=event-handlers-on-elements,-document-objects,-and-window-objects><span class=secno>8.1.6.2</span> Event handlers on elements, <code>Document</code> objects, and <code>Window</code> objects<a href=#event-handlers-on-elements,-document-objects,-and-window-objects class=self-link></a></h5>

  <p>The following are the <a href=#event-handlers id=event-handlers-on-elements,-document-objects,-and-window-objects:event-handlers>event handlers</a> (and their corresponding <span>event handler event types</span>) 
  supported by all <a id=event-handlers-on-elements,-document-objects,-and-window-objects:html-elements href=infrastructure.html#html-elements>HTML elements</a>, as both <a href=#event-handler-content-attributes id=event-handlers-on-elements,-document-objects,-and-window-objects:event-handler-content-attributes>event handler content attributes</a>
  and <a href=#event-handler-idl-attributes id=event-handlers-on-elements,-document-objects,-and-window-objects:event-handler-idl-attributes>event handler IDL attributes</a>; and 
  supported by all <code>Document</code> and <code>Window</code> objects, as <a href=#event-handler-idl-attributes id=event-handlers-on-elements,-document-objects,-and-window-objects:event-handler-idl-attributes-2>event handler IDL
  attributes</a>:</p>

  <table><thead><tr><th><a href=#event-handlers id=event-handlers-on-elements,-document-objects,-and-window-objects:event-handlers-2>Event handler</a> <th><span>Event handler event type</span>
   <tbody><tr><td><dfn data-dfn-for=HTMLElement,Document,Window,GlobalEventHandlers id=handler-onabort data-dfn-type=attribute><code>onabort</code></dfn> <div class="mdn-anno wrapped before"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/abort_event title="The abort event is fired when the resource was not fully loaded, but not as the result of an error.">HTMLMediaElement/abort_event</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>9+</span></span><span class="safari yes"><span>Safari</span><span>3.1+</span></span><span class="chrome yes"><span>Chrome</span><span>3+</span></span><hr><span class="opera yes"><span>Opera</span><span>12.1+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>Internet Explorer</span><span>9+</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios yes"><span>Safari iOS</span><span>3+</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android unknown"><span>WebView Android</span><span>?</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Android</span><span>12.1+</span></span></div></div></div><td> <code>abort</code>
    <tr><td><dfn data-dfn-for=HTMLElement,Document,Window,GlobalEventHandlers id=handler-onauxclick data-dfn-type=attribute><code>onauxclick</code></dfn> <div class="mdn-anno wrapped before"><button onclick=toggleStatus(this) class=mdn-anno-btn><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/Element/auxclick_event title="The auxclick event is fired at an Element when a non-primary pointing device button (any mouse button other than the primary—usually leftmost—button) has been pressed and released both within the same element.">Element/auxclick_event</a><div class=support><span class="firefox yes"><span>Firefox</span><span>53+</span></span><span class="safari no"><span>Safari</span><span>No</span></span><span class="chrome yes"><span>Chrome</span><span>55+</span></span><hr><span class="opera unknown"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge unknown"><span>Edge (Legacy)</span><span>?</span></span><span class="ie no"><span>Internet Explorer</span><span>No</span></span><hr><span class="firefox_android yes"><span>Firefox Android</span><span>53+</span></span><span class="safari_ios unknown"><span>Safari iOS</span><span>?</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android unknown"><span>WebView Android</span><span>?</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android unknown"><span>Opera Android</span><span>?</span></span></div></div></div><td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-auxclick><a data-x-internal=event-auxclick href=https://w3c.github.io/uievents/#event-type-auxclick>auxclick</a></code>
    <tr><td><dfn data-dfn-for=HTMLElement,Document,Window,GlobalEventHandlers id=handler-onbeforeinput data-dfn-type=attribute><code>onbeforeinput</code></dfn> <td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-beforeinput><a data-x-internal=event-beforeinput href=https://w3c.github.io/uievents/#event-type-beforeinput>beforeinput</a></code>
    <tr><td><dfn data-dfn-for=HTMLElement,Document,Window,GlobalEventHandlers id=handler-onbeforematch data-dfn-type=attribute><code>onbeforematch</code></dfn> <td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-beforematch><a href=indices.html#event-beforematch>beforematch</a></code>
    <tr><td><dfn data-dfn-for=HTMLElement,Document,Window,GlobalEventHandlers id=handler-onbeforetoggle data-dfn-type=attribute><code>onbeforetoggle</code></dfn> <td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-beforetoggle><a href=indices.html#event-beforetoggle>beforetoggle</a></code>
    <tr><td><dfn data-dfn-for=HTMLElement,Document,Window,GlobalEventHandlers id=handler-oncancel data-dfn-type=attribute><code>oncancel</code></dfn> <div class="mdn-anno wrapped before"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement/cancel_event title="The cancel event fires on a <dialog> when the user instructs the browser that they wish to dismiss the current open dialog. The browser fires this event when the user presses the Esc key.">HTMLDialogElement/cancel_event</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>98+</span></span><span class="safari yes"><span>Safari</span><span>15.4+</span></span><span class="chrome yes"><span>Chrome</span><span>37+</span></span><hr><span class="opera unknown"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge unknown"><span>Edge (Legacy)</span><span>?</span></span><span class="ie no"><span>Internet Explorer</span><span>No</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios unknown"><span>Safari iOS</span><span>?</span></span><span class="chrome_android no"><span>Chrome Android</span><span>No</span></span><span class="webview_android unknown"><span>WebView Android</span><span>?</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android unknown"><span>Opera Android</span><span>?</span></span></div></div></div><td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-cancel><a href=indices.html#event-cancel>cancel</a></code>
    <tr><td><dfn data-dfn-for=HTMLElement,Document,Window,GlobalEventHandlers id=handler-oncanplay data-dfn-type=attribute><code>oncanplay</code></dfn> <div class="mdn-anno wrapped before"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/canplay_event title="The canplay event is fired when the user agent can play the media, but estimates that not enough data has been loaded to play the media up to its end without having to stop for further buffering of content.">HTMLMediaElement/canplay_event</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>3.5+</span></span><span class="safari yes"><span>Safari</span><span>3.1+</span></span><span class="chrome yes"><span>Chrome</span><span>3+</span></span><hr><span class="opera yes"><span>Opera</span><span>10.5+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>Internet Explorer</span><span>9+</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios yes"><span>Safari iOS</span><span>3+</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android yes"><span>WebView Android</span><span>37+</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Android</span><span>11+</span></span></div></div></div><td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-media-canplay><a href=media.html#event-media-canplay>canplay</a></code>
    <tr><td><dfn data-dfn-for=HTMLElement,Document,Window,GlobalEventHandlers id=handler-oncanplaythrough data-dfn-type=attribute><code>oncanplaythrough</code></dfn> <div class="mdn-anno wrapped before"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/canplaythrough_event title="The canplaythrough event is fired when the user agent can play the media, and estimates that enough data has been loaded to play the media up to its end without having to stop for further buffering of content.">HTMLMediaElement/canplaythrough_event</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>3.5+</span></span><span class="safari yes"><span>Safari</span><span>3.1+</span></span><span class="chrome yes"><span>Chrome</span><span>3+</span></span><hr><span class="opera yes"><span>Opera</span><span>10.5+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>Internet Explorer</span><span>9+</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios yes"><span>Safari iOS</span><span>3+</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android yes"><span>WebView Android</span><span>37+</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Android</span><span>11+</span></span></div></div></div><td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-media-canplaythrough><a href=media.html#event-media-canplaythrough>canplaythrough</a></code>
    <tr><td><dfn data-dfn-for=HTMLElement,Document,Window,GlobalEventHandlers id=handler-onchange data-dfn-type=attribute><code>onchange</code></dfn> <div class="mdn-anno wrapped before"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event title="The change event is fired for <input>, <select>, and <textarea> elements when the user modifies the element's value. Unlike the input event, the change event is not necessarily fired for each alteration to an element's value.">HTMLElement/change_event</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>1+</span></span><span class="safari yes"><span>Safari</span><span>3+</span></span><span class="chrome yes"><span>Chrome</span><span>1+</span></span><hr><span class="opera yes"><span>Opera</span><span>9+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>Internet Explorer</span><span>9+</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios unknown"><span>Safari iOS</span><span>?</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android unknown"><span>WebView Android</span><span>?</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Android</span><span>10.1+</span></span></div></div></div><td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-change><a href=indices.html#event-change>change</a></code> 
    <tr><td><dfn data-dfn-for=HTMLElement,Document,Window,GlobalEventHandlers id=handler-onclick data-dfn-type=attribute><code>onclick</code></dfn> <div class="mdn-anno wrapped before"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/Element/click_event title="An element receives a click event when a pointing device button (such as a mouse's primary mouse button) is both pressed and released while the pointer is located inside the element.">Element/click_event</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>6+</span></span><span class="safari yes"><span>Safari</span><span>3+</span></span><span class="chrome yes"><span>Chrome</span><span>1+</span></span><hr><span class="opera yes"><span>Opera</span><span>11.6+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>Internet Explorer</span><span>9+</span></span><hr><span class="firefox_android yes"><span>Firefox Android</span><span>6+</span></span><span class="safari_ios yes"><span>Safari iOS</span><span>1+</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android unknown"><span>WebView Android</span><span>?</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Android</span><span>12.1+</span></span></div></div></div><td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-click><a data-x-internal=event-click href=https://w3c.github.io/uievents/#event-type-click>click</a></code> 
    <tr><td><dfn data-dfn-for=HTMLElement,Document,Window,GlobalEventHandlers id=handler-onclose data-dfn-type=attribute><code>onclose</code></dfn> <td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-close><a href=indices.html#event-close>close</a></code> 
    <tr><td><dfn data-dfn-for=HTMLElement,Document,Window,GlobalEventHandlers id=handler-oncommand data-dfn-type=attribute><code>oncommand</code></dfn> <td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-command><a href=indices.html#event-command>command</a></code>
    <tr><td><dfn data-dfn-for=HTMLElement,Document,Window,GlobalEventHandlers id=handler-oncontextlost data-dfn-type=attribute><code>oncontextlost</code></dfn> <td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-contextlost><a href=indices.html#event-contextlost>contextlost</a></code>
    <tr><td><dfn data-dfn-for=HTMLElement,Document,Window,GlobalEventHandlers id=handler-oncontextmenu data-dfn-type=attribute><code>oncontextmenu</code></dfn> <td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-contextmenu><a data-x-internal=event-contextmenu href=https://w3c.github.io/uievents/#event-type-contextmenu>contextmenu</a></code> 
    <tr><td><dfn data-dfn-for=HTMLElement,Document,Window,GlobalEventHandlers id=handler-oncontextrestored data-dfn-type=attribute><code>oncontextrestored</code></dfn> <td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-contextrestored><a href=indices.html#event-contextrestored>contextrestored</a></code>
    <tr><td><dfn data-dfn-for=HTMLElement,Document,Window,GlobalEventHandlers id=handler-oncopy data-dfn-type=attribute><code>oncopy</code></dfn> <div class="mdn-anno wrapped before"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/Element/copy_event title="The copy event fires when the user initiates a copy action through the browser's user interface.">Element/copy_event</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>22+</span></span><span class="safari yes"><span>Safari</span><span>3+</span></span><span class="chrome yes"><span>Chrome</span><span>1+</span></span><hr><span class="opera yes"><span>Opera</span><span>12.1+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>Internet Explorer</span><span>9+</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios yes"><span>Safari iOS</span><span>3+</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android unknown"><span>WebView Android</span><span>?</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Android</span><span>12.1+</span></span></div></div></div><td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-copy><a data-x-internal=event-copy href=https://w3c.github.io/clipboard-apis/#clipboard-event-copy>copy</a></code>
    <tr><td><dfn data-dfn-for=HTMLElement,Document,Window,GlobalEventHandlers id=handler-oncuechange data-dfn-type=attribute><code>oncuechange</code></dfn> <div class="mdn-anno wrapped before"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/HTMLTrackElement/cuechange_event title="The cuechange event fires when a TextTrack has changed the currently displaying cues. The event is fired on both the TextTrack and the HTMLTrackElement in which it's being presented, if any.">HTMLTrackElement/cuechange_event</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>68+</span></span><span class="safari yes"><span>Safari</span><span>10+</span></span><span class="chrome yes"><span>Chrome</span><span>32+</span></span><hr><span class="opera yes"><span>Opera</span><span>19+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge yes"><span>Edge (Legacy)</span><span>14+</span></span><span class="ie no"><span>Internet Explorer</span><span>No</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios unknown"><span>Safari iOS</span><span>?</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android yes"><span>WebView Android</span><span>4.4.3+</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Android</span><span>19+</span></span></div></div></div><td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-media-cuechange><a href=media.html#event-media-cuechange>cuechange</a></code>
    <tr><td><dfn data-dfn-for=HTMLElement,Document,Window,GlobalEventHandlers id=handler-oncut data-dfn-type=attribute><code>oncut</code></dfn> <div class="mdn-anno wrapped before"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/Element/cut_event title="The cut event is fired when the user has initiated a &quot;cut&quot; action through the browser's user interface.">Element/cut_event</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>22+</span></span><span class="safari yes"><span>Safari</span><span>3+</span></span><span class="chrome yes"><span>Chrome</span><span>1+</span></span><hr><span class="opera yes"><span>Opera</span><span>12.1+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>Internet Explorer</span><span>9+</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios yes"><span>Safari iOS</span><span>3+</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android unknown"><span>WebView Android</span><span>?</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Android</span><span>12.1+</span></span></div></div></div><td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-cut><a data-x-internal=event-cut href=https://w3c.github.io/clipboard-apis/#clipboard-event-cut>cut</a></code>
    <tr><td><dfn data-dfn-for=HTMLElement,Document,Window,GlobalEventHandlers id=handler-ondblclick data-dfn-type=attribute><code>ondblclick</code></dfn> <div class="mdn-anno wrapped before"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/Element/dblclick_event title="The dblclick event fires when a pointing device button (such as a mouse's primary button) is double-clicked; that is, when it's rapidly clicked twice on a single element within a very short span of time.">Element/dblclick_event</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>6+</span></span><span class="safari yes"><span>Safari</span><span>3+</span></span><span class="chrome yes"><span>Chrome</span><span>1+</span></span><hr><span class="opera yes"><span>Opera</span><span>11.6+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>Internet Explorer</span><span>8+</span></span><hr><span class="firefox_android yes"><span>Firefox Android</span><span>6+</span></span><span class="safari_ios yes"><span>Safari iOS</span><span>1+</span></span><span class="chrome_android no"><span>Chrome Android</span><span>No</span></span><span class="webview_android unknown"><span>WebView Android</span><span>?</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Android</span><span>12.1+</span></span></div></div></div><td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-dblclick><a data-x-internal=event-dblclick href=https://w3c.github.io/uievents/#event-type-dblclick>dblclick</a></code> 
    <tr><td><dfn data-dfn-for=HTMLElement,Document,Window,GlobalEventHandlers id=handler-ondrag data-dfn-type=attribute><code>ondrag</code></dfn> <td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-dnd-drag><a href=dnd.html#event-dnd-drag>drag</a></code>
    <tr><td><dfn data-dfn-for=HTMLElement,Document,Window,GlobalEventHandlers id=handler-ondragend data-dfn-type=attribute><code>ondragend</code></dfn> <td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-dnd-dragend><a href=dnd.html#event-dnd-dragend>dragend</a></code>
    <tr><td><dfn data-dfn-for=HTMLElement,Document,Window,GlobalEventHandlers id=handler-ondragenter data-dfn-type=attribute><code>ondragenter</code></dfn> <td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-dnd-dragenter><a href=dnd.html#event-dnd-dragenter>dragenter</a></code>
    <tr><td><dfn data-dfn-for=HTMLElement,Document,Window,GlobalEventHandlers id=handler-ondragleave data-dfn-type=attribute><code>ondragleave</code></dfn> <td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-dnd-dragleave><a href=dnd.html#event-dnd-dragleave>dragleave</a></code>
    <tr><td><dfn data-dfn-for=HTMLElement,Document,Window,GlobalEventHandlers id=handler-ondragover data-dfn-type=attribute><code>ondragover</code></dfn> <td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-dnd-dragover><a href=dnd.html#event-dnd-dragover>dragover</a></code>
    <tr><td><dfn data-dfn-for=HTMLElement,Document,Window,GlobalEventHandlers id=handler-ondragstart data-dfn-type=attribute><code>ondragstart</code></dfn> <td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-dnd-dragstart><a href=dnd.html#event-dnd-dragstart>dragstart</a></code> 
    <tr><td><dfn data-dfn-for=HTMLElement,Document,Window,GlobalEventHandlers id=handler-ondrop data-dfn-type=attribute><code>ondrop</code></dfn> <td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-dnd-drop><a href=dnd.html#event-dnd-drop>drop</a></code>
    <tr><td><dfn data-dfn-for=HTMLElement,Document,Window,GlobalEventHandlers id=handler-ondurationchange data-dfn-type=attribute><code>ondurationchange</code></dfn> <div class="mdn-anno wrapped before"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/durationchange_event title="The durationchange event is fired when the duration attribute has been updated.">HTMLMediaElement/durationchange_event</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>3.5+</span></span><span class="safari yes"><span>Safari</span><span>3.1+</span></span><span class="chrome yes"><span>Chrome</span><span>3+</span></span><hr><span class="opera yes"><span>Opera</span><span>10.5+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>Internet Explorer</span><span>9+</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios yes"><span>Safari iOS</span><span>3+</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android yes"><span>WebView Android</span><span>37+</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Android</span><span>11+</span></span></div></div></div><td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-media-durationchange><a href=media.html#event-media-durationchange>durationchange</a></code>
    <tr><td><dfn data-dfn-for=HTMLElement,Document,Window,GlobalEventHandlers id=handler-onemptied data-dfn-type=attribute><code>onemptied</code></dfn> <div class="mdn-anno wrapped before"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/emptied_event title="The emptied event is fired when the media has become empty; for example, this event is sent if the media has already been loaded (or partially loaded), and the load() method is called to reload it.">HTMLMediaElement/emptied_event</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>3.5+</span></span><span class="safari yes"><span>Safari</span><span>3.1+</span></span><span class="chrome yes"><span>Chrome</span><span>3+</span></span><hr><span class="opera yes"><span>Opera</span><span>10.5+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>Internet Explorer</span><span>9+</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios yes"><span>Safari iOS</span><span>3+</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android yes"><span>WebView Android</span><span>37+</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Android</span><span>11+</span></span></div></div></div><td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-media-emptied><a href=media.html#event-media-emptied>emptied</a></code>
    <tr><td><dfn data-dfn-for=HTMLElement,Document,Window,GlobalEventHandlers id=handler-onended data-dfn-type=attribute><code>onended</code></dfn> <div class="mdn-anno wrapped before"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/ended_event title="The ended event is fired when playback or streaming has stopped because the end of the media was reached or because no further data is available.">HTMLMediaElement/ended_event</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>3.5+</span></span><span class="safari yes"><span>Safari</span><span>3.1+</span></span><span class="chrome yes"><span>Chrome</span><span>3+</span></span><hr><span class="opera yes"><span>Opera</span><span>10.5+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>Internet Explorer</span><span>9+</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios yes"><span>Safari iOS</span><span>3+</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android yes"><span>WebView Android</span><span>37+</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Android</span><span>11+</span></span></div></div></div><td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-media-ended><a href=media.html#event-media-ended>ended</a></code>
    <tr><td><dfn data-dfn-for=HTMLElement,Document,Window,GlobalEventHandlers id=handler-onformdata data-dfn-type=attribute><code>onformdata</code></dfn> <td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-formdata><a href=indices.html#event-formdata>formdata</a></code>
    <tr><td><dfn data-dfn-for=HTMLElement,Document,Window,GlobalEventHandlers id=handler-oninput data-dfn-type=attribute><code>oninput</code></dfn> <div class="mdn-anno wrapped before"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event title="The input event fires when the value of an <input>, <select>, or <textarea> element has been changed.">HTMLElement/input_event</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>6+</span></span><span class="safari yes"><span>Safari</span><span>3.1+</span></span><span class="chrome yes"><span>Chrome</span><span>1+</span></span><hr><span class="opera yes"><span>Opera</span><span>11.6+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge no"><span>Edge (Legacy)</span><span>No</span></span><span class="ie yes"><span>Internet Explorer</span><span title="Partial implementation.">🔰 9+</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios unknown"><span>Safari iOS</span><span>?</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android unknown"><span>WebView Android</span><span>?</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Android</span><span>12+</span></span></div></div></div><td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-input><a data-x-internal=event-input href=https://w3c.github.io/uievents/#event-type-input>input</a></code>
    <tr><td><dfn data-dfn-for=HTMLElement,Document,Window,GlobalEventHandlers id=handler-oninvalid data-dfn-type=attribute><code>oninvalid</code></dfn> <td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-invalid><a href=indices.html#event-invalid>invalid</a></code>
    <tr><td><dfn data-dfn-for=HTMLElement,Document,Window,GlobalEventHandlers id=handler-onkeydown data-dfn-type=attribute><code>onkeydown</code></dfn> <div class="mdn-anno wrapped before"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/Element/keydown_event title="The keydown event is fired when a key is pressed.">Element/keydown_event</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>6+</span></span><span class="safari yes"><span>Safari</span><span>1.2+</span></span><span class="chrome yes"><span>Chrome</span><span>1+</span></span><hr><span class="opera yes"><span>Opera</span><span>12.1+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>Internet Explorer</span><span>9+</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios unknown"><span>Safari iOS</span><span>?</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android unknown"><span>WebView Android</span><span>?</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Android</span><span>12.1+</span></span></div></div></div><td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-keydown><a data-x-internal=event-keydown href=https://w3c.github.io/uievents/#event-type-keydown>keydown</a></code> 
    <tr><td><dfn data-dfn-for=HTMLElement,Document,Window,GlobalEventHandlers id=handler-onkeypress data-dfn-type=attribute><code>onkeypress</code></dfn> <td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-keypress><a data-x-internal=event-keypress href=https://w3c.github.io/uievents/#event-type-keypress>keypress</a></code> 
    <tr><td><dfn data-dfn-for=HTMLElement,Document,Window,GlobalEventHandlers id=handler-onkeyup data-dfn-type=attribute><code>onkeyup</code></dfn> <div class="mdn-anno wrapped before"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/Element/keyup_event title="The keyup event is fired when a key is released.">Element/keyup_event</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>6+</span></span><span class="safari yes"><span>Safari</span><span>1.2+</span></span><span class="chrome yes"><span>Chrome</span><span>1+</span></span><hr><span class="opera yes"><span>Opera</span><span>12.1+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>Internet Explorer</span><span>9+</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios unknown"><span>Safari iOS</span><span>?</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android unknown"><span>WebView Android</span><span>?</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Android</span><span>12.1+</span></span></div></div></div><td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-keyup><a data-x-internal=event-keyup href=https://w3c.github.io/uievents/#event-type-keyup>keyup</a></code> 
    <tr><td><dfn data-dfn-for=HTMLElement,Document,Window,GlobalEventHandlers id=handler-onloadeddata data-dfn-type=attribute><code>onloadeddata</code></dfn> <div class="mdn-anno wrapped before"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/loadeddata_event title="The loadeddata event is fired when the frame at the current playback position of the media has finished loading; often the first frame.">HTMLMediaElement/loadeddata_event</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>3.5+</span></span><span class="safari yes"><span>Safari</span><span>3.1+</span></span><span class="chrome yes"><span>Chrome</span><span>3+</span></span><hr><span class="opera yes"><span>Opera</span><span>10.5+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>Internet Explorer</span><span>9+</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios yes"><span>Safari iOS</span><span>3+</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android yes"><span>WebView Android</span><span>37+</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Android</span><span>11+</span></span></div></div></div><td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-media-loadeddata><a href=media.html#event-media-loadeddata>loadeddata</a></code>
    <tr><td><dfn data-dfn-for=HTMLElement,Document,Window,GlobalEventHandlers id=handler-onloadedmetadata data-dfn-type=attribute><code>onloadedmetadata</code></dfn> <div class="mdn-anno wrapped before"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/loadedmetadata_event title="The loadedmetadata event is fired when the metadata has been loaded.">HTMLMediaElement/loadedmetadata_event</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>3.5+</span></span><span class="safari yes"><span>Safari</span><span>3.1+</span></span><span class="chrome yes"><span>Chrome</span><span>3+</span></span><hr><span class="opera yes"><span>Opera</span><span>10.5+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>Internet Explorer</span><span>9+</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios yes"><span>Safari iOS</span><span>3+</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android yes"><span>WebView Android</span><span>37+</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Android</span><span>11+</span></span></div></div></div><td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-media-loadedmetadata><a href=media.html#event-media-loadedmetadata>loadedmetadata</a></code>
    <tr><td><dfn data-dfn-for=HTMLElement,Document,Window,GlobalEventHandlers id=handler-onloadstart data-dfn-type=attribute><code>onloadstart</code></dfn> <div class="mdn-anno wrapped before"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/loadstart_event title="The loadstart event is fired when the browser has started to load a resource.">HTMLMediaElement/loadstart_event</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>6+</span></span><span class="safari yes"><span>Safari</span><span>4+</span></span><span class="chrome yes"><span>Chrome</span><span>3+</span></span><hr><span class="opera yes"><span>Opera</span><span>12.1+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>Internet Explorer</span><span>9+</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios yes"><span>Safari iOS</span><span>3+</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android unknown"><span>WebView Android</span><span>?</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Android</span><span>12.1+</span></span></div></div></div><td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-media-loadstart><a href=media.html#event-media-loadstart>loadstart</a></code>
    <tr><td><dfn data-dfn-for=HTMLElement,Document,Window,GlobalEventHandlers id=handler-onmousedown data-dfn-type=attribute><code>onmousedown</code></dfn> <div class="mdn-anno wrapped before"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/Element/mousedown_event title="The mousedown event is fired at an Element when a pointing device button is pressed while the pointer is inside the element.">Element/mousedown_event</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>6+</span></span><span class="safari yes"><span>Safari</span><span>4+</span></span><span class="chrome yes"><span>Chrome</span><span>2+</span></span><hr><span class="opera yes"><span>Opera</span><span>11.6+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>Internet Explorer</span><span>9+</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios unknown"><span>Safari iOS</span><span>?</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android yes"><span>WebView Android</span><span>37+</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Android</span><span>12.1+</span></span></div></div></div><td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-mousedown><a data-x-internal=event-mousedown href=https://w3c.github.io/uievents/#event-type-mousedown>mousedown</a></code> 
    <tr><td><dfn data-dfn-for=HTMLElement,Document,Window,GlobalEventHandlers id=handler-onmouseenter data-dfn-type=attribute><code>onmouseenter</code></dfn> <div class="mdn-anno wrapped before"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/Element/mouseenter_event title="The mouseenter event is fired at an Element when a pointing device (usually a mouse) is initially moved so that its hotspot is within the element at which the event was fired.">Element/mouseenter_event</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>10+</span></span><span class="safari yes"><span>Safari</span><span>7+</span></span><span class="chrome yes"><span>Chrome</span><span>30+</span></span><hr><span class="opera unknown"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>Internet Explorer</span><span>5.5+</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios unknown"><span>Safari iOS</span><span>?</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android yes"><span>WebView Android</span><span>37+</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android unknown"><span>Opera Android</span><span>?</span></span></div></div></div><td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-mouseenter><a data-x-internal=event-mouseenter href=https://w3c.github.io/uievents/#event-type-mouseenter>mouseenter</a></code> 
    <tr><td><dfn data-dfn-for=HTMLElement,Document,Window,GlobalEventHandlers id=handler-onmouseleave data-dfn-type=attribute><code>onmouseleave</code></dfn> <div class="mdn-anno wrapped before"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/Element/mouseleave_event title="The mouseleave event is fired at an Element when the cursor of a pointing device (usually a mouse) is moved out of it.">Element/mouseleave_event</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>10+</span></span><span class="safari yes"><span>Safari</span><span>7+</span></span><span class="chrome yes"><span>Chrome</span><span>30+</span></span><hr><span class="opera unknown"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>Internet Explorer</span><span>5.5+</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios unknown"><span>Safari iOS</span><span>?</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android yes"><span>WebView Android</span><span>37+</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android unknown"><span>Opera Android</span><span>?</span></span></div></div></div><td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-mouseleave><a data-x-internal=event-mouseleave href=https://w3c.github.io/uievents/#event-type-mouseleave>mouseleave</a></code> 
    <tr><td><dfn data-dfn-for=HTMLElement,Document,Window,GlobalEventHandlers id=handler-onmousemove data-dfn-type=attribute><code>onmousemove</code></dfn> <div class="mdn-anno wrapped before"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/Element/mousemove_event title="The mousemove event is fired at an element when a pointing device (usually a mouse) is moved while the cursor's hotspot is inside it.">Element/mousemove_event</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>6+</span></span><span class="safari yes"><span>Safari</span><span>4+</span></span><span class="chrome yes"><span>Chrome</span><span>2+</span></span><hr><span class="opera yes"><span>Opera</span><span>11.6+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>Internet Explorer</span><span>9+</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios unknown"><span>Safari iOS</span><span>?</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android yes"><span>WebView Android</span><span>37+</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Android</span><span>12.1+</span></span></div></div></div><td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-mousemove><a data-x-internal=event-mousemove href=https://w3c.github.io/uievents/#event-type-mousemove>mousemove</a></code> 
    <tr><td><dfn data-dfn-for=HTMLElement,Document,Window,GlobalEventHandlers id=handler-onmouseout data-dfn-type=attribute><code>onmouseout</code></dfn> <div class="mdn-anno wrapped before"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/Element/mouseout_event title="The mouseout event is fired at an Element when a pointing device (usually a mouse) is used to move the cursor so that it is no longer contained within the element or one of its children.">Element/mouseout_event</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>6+</span></span><span class="safari yes"><span>Safari</span><span>1+</span></span><span class="chrome yes"><span>Chrome</span><span>1+</span></span><hr><span class="opera yes"><span>Opera</span><span>12.1+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>Internet Explorer</span><span>9+</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios unknown"><span>Safari iOS</span><span>?</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android yes"><span>WebView Android</span><span>37+</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Android</span><span>12.1+</span></span></div></div></div><td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-mouseout><a data-x-internal=event-mouseout href=https://w3c.github.io/uievents/#event-type-mouseout>mouseout</a></code> 
    <tr><td><dfn data-dfn-for=HTMLElement,Document,Window,GlobalEventHandlers id=handler-onmouseover data-dfn-type=attribute><code>onmouseover</code></dfn> <div class="mdn-anno wrapped before"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/Element/mouseover_event title="The mouseover event is fired at an Element when a pointing device (such as a mouse or trackpad) is used to move the cursor onto the element or one of its child elements.">Element/mouseover_event</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>6+</span></span><span class="safari yes"><span>Safari</span><span>4+</span></span><span class="chrome yes"><span>Chrome</span><span>2+</span></span><hr><span class="opera yes"><span>Opera</span><span>9.5+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>Internet Explorer</span><span>9+</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios unknown"><span>Safari iOS</span><span>?</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android yes"><span>WebView Android</span><span>37+</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Android</span><span>10.1+</span></span></div></div></div><td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-mouseover><a data-x-internal=event-mouseover href=https://w3c.github.io/uievents/#event-type-mouseover>mouseover</a></code> 
    <tr><td><dfn data-dfn-for=HTMLElement,Document,Window,GlobalEventHandlers id=handler-onmouseup data-dfn-type=attribute><code>onmouseup</code></dfn> <div class="mdn-anno wrapped before"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/Element/mouseup_event title="The mouseup event is fired at an Element when a button on a pointing device (such as a mouse or trackpad) is released while the pointer is located inside it.">Element/mouseup_event</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>6+</span></span><span class="safari yes"><span>Safari</span><span>4+</span></span><span class="chrome yes"><span>Chrome</span><span>2+</span></span><hr><span class="opera yes"><span>Opera</span><span>11.6+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>Internet Explorer</span><span>9+</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios unknown"><span>Safari iOS</span><span>?</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android yes"><span>WebView Android</span><span>37+</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Android</span><span>12.1+</span></span></div></div></div><td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-mouseup><a data-x-internal=event-mouseup href=https://w3c.github.io/uievents/#event-type-mouseup>mouseup</a></code> 
    <tr><td><dfn data-dfn-for=HTMLElement,Document,Window,GlobalEventHandlers id=handler-onpaste data-dfn-type=attribute><code>onpaste</code></dfn> <div class="mdn-anno wrapped before"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/Element/paste_event title="The paste event is fired when the user has initiated a &quot;paste&quot; action through the browser's user interface.">Element/paste_event</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>22+</span></span><span class="safari yes"><span>Safari</span><span>3+</span></span><span class="chrome yes"><span>Chrome</span><span>1+</span></span><hr><span class="opera yes"><span>Opera</span><span>12.1+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>Internet Explorer</span><span>9+</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios yes"><span>Safari iOS</span><span>3+</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android yes"><span>WebView Android</span><span>37+</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Android</span><span>12.1+</span></span></div></div></div><td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-paste><a data-x-internal=event-paste href=https://w3c.github.io/clipboard-apis/#clipboard-event-paste>paste</a></code>
    <tr><td><dfn data-dfn-for=HTMLElement,Document,Window,GlobalEventHandlers id=handler-onpause data-dfn-type=attribute><code>onpause</code></dfn> <div class="mdn-anno wrapped before"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/pause_event title="The pause event is sent when a request to pause an activity is handled and the activity has entered its paused state, most commonly after the media has been paused through a call to the element's pause() method.">HTMLMediaElement/pause_event</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>3.5+</span></span><span class="safari yes"><span>Safari</span><span>3.1+</span></span><span class="chrome yes"><span>Chrome</span><span>3+</span></span><hr><span class="opera yes"><span>Opera</span><span>10.5+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>Internet Explorer</span><span>9+</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios yes"><span>Safari iOS</span><span>3+</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android yes"><span>WebView Android</span><span>37+</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Android</span><span>11+</span></span></div></div></div><td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-media-pause><a href=media.html#event-media-pause>pause</a></code>
    <tr><td><dfn data-dfn-for=HTMLElement,Document,Window,GlobalEventHandlers id=handler-onplay data-dfn-type=attribute><code>onplay</code></dfn> <div class="mdn-anno wrapped before"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/play_event title="The play event is fired when the paused property is changed from true to false, as a result of the play method, or the autoplay attribute.">HTMLMediaElement/play_event</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>3.5+</span></span><span class="safari yes"><span>Safari</span><span>3.1+</span></span><span class="chrome yes"><span>Chrome</span><span>3+</span></span><hr><span class="opera yes"><span>Opera</span><span>10.5+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>Internet Explorer</span><span>9+</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios yes"><span>Safari iOS</span><span>3+</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android yes"><span>WebView Android</span><span>37+</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Android</span><span>11+</span></span></div></div></div><td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-media-play><a href=media.html#event-media-play>play</a></code>
    <tr><td><dfn data-dfn-for=HTMLElement,Document,Window,GlobalEventHandlers id=handler-onplaying data-dfn-type=attribute><code>onplaying</code></dfn> <div class="mdn-anno wrapped before"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/playing_event title="The playing event is fired after playback is first started, and whenever it is restarted. For example it is fired when playback resumes after having been paused or delayed due to lack of data.">HTMLMediaElement/playing_event</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>3.5+</span></span><span class="safari yes"><span>Safari</span><span>3.1+</span></span><span class="chrome yes"><span>Chrome</span><span>3+</span></span><hr><span class="opera yes"><span>Opera</span><span>10.5+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>Internet Explorer</span><span>9+</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios yes"><span>Safari iOS</span><span>3+</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android yes"><span>WebView Android</span><span>37+</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Android</span><span>11+</span></span></div></div></div><td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-media-playing><a href=media.html#event-media-playing>playing</a></code>
    <tr><td><dfn data-dfn-for=HTMLElement,Document,Window,GlobalEventHandlers id=handler-onprogress data-dfn-type=attribute><code>onprogress</code></dfn> <div class="mdn-anno wrapped before"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/progress_event title="The progress event is fired periodically as the browser loads a resource.">HTMLMediaElement/progress_event</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>6+</span></span><span class="safari yes"><span>Safari</span><span>3.1+</span></span><span class="chrome yes"><span>Chrome</span><span>3+</span></span><hr><span class="opera yes"><span>Opera</span><span>12.1+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>Internet Explorer</span><span>9+</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios yes"><span>Safari iOS</span><span>3+</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android unknown"><span>WebView Android</span><span>?</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Android</span><span>12.1+</span></span></div></div></div><td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-media-progress><a href=media.html#event-media-progress>progress</a></code>
    <tr><td><dfn data-dfn-for=HTMLElement,Document,Window,GlobalEventHandlers id=handler-onratechange data-dfn-type=attribute><code>onratechange</code></dfn> <div class="mdn-anno wrapped before"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/ratechange_event title="The ratechange event is fired when the playback rate has changed.">HTMLMediaElement/ratechange_event</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>3.5+</span></span><span class="safari yes"><span>Safari</span><span>3.1+</span></span><span class="chrome yes"><span>Chrome</span><span>3+</span></span><hr><span class="opera yes"><span>Opera</span><span>10.5+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>Internet Explorer</span><span>9+</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios yes"><span>Safari iOS</span><span>3+</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android yes"><span>WebView Android</span><span>37+</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Android</span><span>11+</span></span></div></div></div><td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-media-ratechange><a href=media.html#event-media-ratechange>ratechange</a></code>
    <tr><td><dfn data-dfn-for=HTMLElement,Document,Window,GlobalEventHandlers id=handler-onreset data-dfn-type=attribute><code>onreset</code></dfn> <td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-reset><a href=indices.html#event-reset>reset</a></code>
    <tr><td><dfn data-dfn-for=HTMLElement,Document,Window,GlobalEventHandlers id=handler-onscrollend data-dfn-type=attribute><code>onscrollend</code></dfn> <div class="mdn-anno wrapped before"><button onclick=toggleStatus(this) class=mdn-anno-btn><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/Document/scrollend_event title="The scrollend event fires when the document view has completed scrolling. Scrolling is considered completed when the scroll position has no more pending updates and the user has completed their gesture.">Document/scrollend_event</a><div class=support><span class="firefox yes"><span>Firefox</span><span>109+</span></span><span class="safari no"><span>Safari</span><span>No</span></span><span class="chrome yes"><span>Chrome</span><span>114+</span></span><hr><span class="opera unknown"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>114+</span></span><hr><span class="edge unknown"><span>Edge (Legacy)</span><span>?</span></span><span class="ie no"><span>Internet Explorer</span><span>No</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios unknown"><span>Safari iOS</span><span>?</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android unknown"><span>WebView Android</span><span>?</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android unknown"><span>Opera Android</span><span>?</span></span></div></div><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollend_event title="The scrollend event fires when element scrolling has completed. Scrolling is considered completed when the scroll position has no more pending updates and the user has completed their gesture.">Element/scrollend_event</a><div class=support><span class="firefox yes"><span>Firefox</span><span>109+</span></span><span class="safari no"><span>Safari</span><span>No</span></span><span class="chrome yes"><span>Chrome</span><span>114+</span></span><hr><span class="opera unknown"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>114+</span></span><hr><span class="edge unknown"><span>Edge (Legacy)</span><span>?</span></span><span class="ie no"><span>Internet Explorer</span><span>No</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios unknown"><span>Safari iOS</span><span>?</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android unknown"><span>WebView Android</span><span>?</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android unknown"><span>Opera Android</span><span>?</span></span></div></div></div><td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-scrollend><a data-x-internal=event-scrollend href=https://drafts.csswg.org/cssom-view/#eventdef-document-scrollend>scrollend</a></code>
    <tr><td><dfn data-dfn-for=HTMLElement,Document,Window,GlobalEventHandlers id=handler-onsecuritypolicyviolation data-dfn-type=attribute><code>onsecuritypolicyviolation</code></dfn> <div class="mdn-anno wrapped before"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/Element/securitypolicyviolation_event title="The securitypolicyviolation event is fired when a Content Security Policy is violated.">Element/securitypolicyviolation_event</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>63+</span></span><span class="safari yes"><span>Safari</span><span>10+</span></span><span class="chrome yes"><span>Chrome</span><span>41+</span></span><hr><span class="opera unknown"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge yes"><span>Edge (Legacy)</span><span>15+</span></span><span class="ie no"><span>Internet Explorer</span><span>No</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios unknown"><span>Safari iOS</span><span>?</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android unknown"><span>WebView Android</span><span>?</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android unknown"><span>Opera Android</span><span>?</span></span></div></div></div><td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-securitypolicyviolation><a data-x-internal=event-securitypolicyviolation href=https://w3c.github.io/webappsec-csp/#eventdef-globaleventhandlers-securitypolicyviolation>securitypolicyviolation</a></code>
    <tr><td><dfn data-dfn-for=HTMLElement,Document,Window,GlobalEventHandlers id=handler-onseeked data-dfn-type=attribute><code>onseeked</code></dfn> <div class="mdn-anno wrapped before"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/seeked_event title="The seeked event is fired when a seek operation completed, the current playback position has changed, and the Boolean seeking attribute is changed to false.">HTMLMediaElement/seeked_event</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>3.5+</span></span><span class="safari yes"><span>Safari</span><span>3.1+</span></span><span class="chrome yes"><span>Chrome</span><span>3+</span></span><hr><span class="opera yes"><span>Opera</span><span>10.5+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>Internet Explorer</span><span>9+</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios yes"><span>Safari iOS</span><span>3+</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android yes"><span>WebView Android</span><span>37+</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Android</span><span>11+</span></span></div></div></div><td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-media-seeked><a href=media.html#event-media-seeked>seeked</a></code>
    <tr><td><dfn data-dfn-for=HTMLElement,Document,Window,GlobalEventHandlers id=handler-onseeking data-dfn-type=attribute><code>onseeking</code></dfn> <div class="mdn-anno wrapped before"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/seeking_event title="The seeking event is fired when a seek operation starts, meaning the Boolean seeking attribute has changed to true and the media is seeking a new position.">HTMLMediaElement/seeking_event</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>3.5+</span></span><span class="safari yes"><span>Safari</span><span>3.1+</span></span><span class="chrome yes"><span>Chrome</span><span>3+</span></span><hr><span class="opera yes"><span>Opera</span><span>10.5+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>Internet Explorer</span><span>9+</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios yes"><span>Safari iOS</span><span>3+</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android yes"><span>WebView Android</span><span>37+</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Android</span><span>11+</span></span></div></div></div><td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-media-seeking><a href=media.html#event-media-seeking>seeking</a></code>
    <tr><td><dfn data-dfn-for=HTMLElement,Document,Window,GlobalEventHandlers id=handler-onselect data-dfn-type=attribute><code>onselect</code></dfn> <div class="mdn-anno wrapped before"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/select_event title="The select event fires when some text has been selected.">HTMLInputElement/select_event</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>6+</span></span><span class="safari yes"><span>Safari</span><span>1+</span></span><span class="chrome yes"><span>Chrome</span><span>1+</span></span><hr><span class="opera yes"><span>Opera</span><span>12.1+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>Internet Explorer</span><span>9+</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios unknown"><span>Safari iOS</span><span>?</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android unknown"><span>WebView Android</span><span>?</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Android</span><span>12.1+</span></span></div></div><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/HTMLTextAreaElement/select_event title="The select event fires when some text has been selected.">HTMLTextAreaElement/select_event</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>6+</span></span><span class="safari yes"><span>Safari</span><span>1+</span></span><span class="chrome yes"><span>Chrome</span><span>1+</span></span><hr><span class="opera yes"><span>Opera</span><span>12.1+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>Internet Explorer</span><span>9+</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios unknown"><span>Safari iOS</span><span>?</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android unknown"><span>WebView Android</span><span>?</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Android</span><span>12.1+</span></span></div></div></div><td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-select><a href=indices.html#event-select>select</a></code>  
    <tr><td><dfn data-dfn-for=HTMLElement,Document,Window,GlobalEventHandlers id=handler-onslotchange data-dfn-type=attribute><code>onslotchange</code></dfn> <div class="mdn-anno wrapped before"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/HTMLSlotElement/slotchange_event title="The slotchange event is fired on an HTMLSlotElement instance (<slot> element) when the node(s) contained in that slot change.">HTMLSlotElement/slotchange_event</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>63+</span></span><span class="safari yes"><span>Safari</span><span>10.1+</span></span><span class="chrome yes"><span>Chrome</span><span>53+</span></span><hr><span class="opera unknown"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge unknown"><span>Edge (Legacy)</span><span>?</span></span><span class="ie no"><span>Internet Explorer</span><span>No</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios unknown"><span>Safari iOS</span><span>?</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android unknown"><span>WebView Android</span><span>?</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android unknown"><span>Opera Android</span><span>?</span></span></div></div></div><td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-slotchange><a data-x-internal=event-slotchange href=https://dom.spec.whatwg.org/#eventdef-htmlslotelement-slotchange>slotchange</a></code>
    <tr><td><dfn data-dfn-for=HTMLElement,Document,Window,GlobalEventHandlers id=handler-onstalled data-dfn-type=attribute><code>onstalled</code></dfn> <div class="mdn-anno wrapped before"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/stalled_event title="The stalled event is fired when the user agent is trying to fetch media data, but data is unexpectedly not forthcoming.">HTMLMediaElement/stalled_event</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>3.5+</span></span><span class="safari yes"><span>Safari</span><span>3.1+</span></span><span class="chrome yes"><span>Chrome</span><span>3+</span></span><hr><span class="opera yes"><span>Opera</span><span>10.5+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>Internet Explorer</span><span>9+</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios yes"><span>Safari iOS</span><span>3+</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android yes"><span>WebView Android</span><span>37+</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Android</span><span>11+</span></span></div></div></div><td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-media-stalled><a href=media.html#event-media-stalled>stalled</a></code>
    <tr><td><dfn data-dfn-for=HTMLElement,Document,Window,GlobalEventHandlers id=handler-onsubmit data-dfn-type=attribute><code>onsubmit</code></dfn> <div class="mdn-anno wrapped before"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/submit_event title="The submit event fires when a <form> is submitted.">HTMLFormElement/submit_event</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>1+</span></span><span class="safari yes"><span>Safari</span><span>3+</span></span><span class="chrome yes"><span>Chrome</span><span>1+</span></span><hr><span class="opera yes"><span>Opera</span><span>8+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>Internet Explorer</span><span>9+</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios yes"><span>Safari iOS</span><span>1+</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android unknown"><span>WebView Android</span><span>?</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Android</span><span>10.1+</span></span></div></div></div><td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-submit><a href=indices.html#event-submit>submit</a></code> 
    <tr><td><dfn data-dfn-for=HTMLElement,Document,Window,GlobalEventHandlers id=handler-onsuspend data-dfn-type=attribute><code>onsuspend</code></dfn> <div class="mdn-anno wrapped before"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/suspend_event title="The suspend event is fired when media data loading has been suspended.">HTMLMediaElement/suspend_event</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>3.5+</span></span><span class="safari yes"><span>Safari</span><span>3.1+</span></span><span class="chrome yes"><span>Chrome</span><span>3+</span></span><hr><span class="opera yes"><span>Opera</span><span>10.5+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>Internet Explorer</span><span>9+</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios yes"><span>Safari iOS</span><span>3+</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android yes"><span>WebView Android</span><span>37+</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Android</span><span>11+</span></span></div></div></div><td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-media-suspend><a href=media.html#event-media-suspend>suspend</a></code>
    <tr><td><dfn data-dfn-for=HTMLElement,Document,Window,GlobalEventHandlers id=handler-ontimeupdate data-dfn-type=attribute><code>ontimeupdate</code></dfn> <div class="mdn-anno wrapped before"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/timeupdate_event title="The timeupdate event is fired when the time indicated by the currentTime attribute has been updated.">HTMLMediaElement/timeupdate_event</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>3.5+</span></span><span class="safari yes"><span>Safari</span><span>3.1+</span></span><span class="chrome yes"><span>Chrome</span><span>3+</span></span><hr><span class="opera yes"><span>Opera</span><span>10.5+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>Internet Explorer</span><span>9+</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios yes"><span>Safari iOS</span><span>3+</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android yes"><span>WebView Android</span><span>37+</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Android</span><span>11+</span></span></div></div></div><td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-media-timeupdate><a href=media.html#event-media-timeupdate>timeupdate</a></code>
    <tr><td><dfn data-dfn-for=HTMLElement,Document,Window,GlobalEventHandlers id=handler-ontoggle data-dfn-type=attribute><code>ontoggle</code></dfn> <td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-toggle><a href=indices.html#event-toggle>toggle</a></code>
    <tr><td><dfn data-dfn-for=HTMLElement,Document,Window,GlobalEventHandlers id=handler-onvolumechange data-dfn-type=attribute><code>onvolumechange</code></dfn> <div class="mdn-anno wrapped before"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/volumechange_event title="The volumechange event is fired when either the volume attribute or the muted attribute has changed.">HTMLMediaElement/volumechange_event</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>6+</span></span><span class="safari yes"><span>Safari</span><span>3.1+</span></span><span class="chrome yes"><span>Chrome</span><span>3+</span></span><hr><span class="opera yes"><span>Opera</span><span>12.1+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>Internet Explorer</span><span>9+</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios yes"><span>Safari iOS</span><span>3+</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android yes"><span>WebView Android</span><span>37+</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Android</span><span>12.1+</span></span></div></div></div><td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-media-volumechange><a href=media.html#event-media-volumechange>volumechange</a></code>
    <tr><td><dfn data-dfn-for=HTMLElement,Document,Window,GlobalEventHandlers id=handler-onwaiting data-dfn-type=attribute><code>onwaiting</code></dfn> <div class="mdn-anno wrapped before"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/waiting_event title="The waiting event is fired when playback has stopped because of a temporary lack of data.">HTMLMediaElement/waiting_event</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>6+</span></span><span class="safari yes"><span>Safari</span><span>3.1+</span></span><span class="chrome yes"><span>Chrome</span><span>3+</span></span><hr><span class="opera yes"><span>Opera</span><span>12.1+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>Internet Explorer</span><span>9+</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios yes"><span>Safari iOS</span><span>3+</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android yes"><span>WebView Android</span><span>37+</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Android</span><span>12.1+</span></span></div></div></div><td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-media-waiting><a href=media.html#event-media-waiting>waiting</a></code>
    <tr><td><dfn data-dfn-for=HTMLElement,Document,Window,GlobalEventHandlers id=handler-onwebkitanimationend data-dfn-type=attribute><code>onwebkitanimationend</code></dfn> <td> <code>webkitAnimationEnd</code>
    <tr><td><dfn data-dfn-for=HTMLElement,Document,Window,GlobalEventHandlers id=handler-onwebkitanimationiteration data-dfn-type=attribute><code>onwebkitanimationiteration</code></dfn> <td> <code>webkitAnimationIteration</code>
    <tr><td><dfn data-dfn-for=HTMLElement,Document,Window,GlobalEventHandlers id=handler-onwebkitanimationstart data-dfn-type=attribute><code>onwebkitanimationstart</code></dfn> <td> <code>webkitAnimationStart</code>
    <tr><td><dfn data-dfn-for=HTMLElement,Document,Window,GlobalEventHandlers id=handler-onwebkittransitionend data-dfn-type=attribute><code>onwebkittransitionend</code></dfn> <td> <code>webkitTransitionEnd</code>
    <tr><td><dfn data-dfn-for=HTMLElement,Document,Window,GlobalEventHandlers id=handler-onwheel data-dfn-type=attribute><code>onwheel</code></dfn> <div class="mdn-anno wrapped before"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/Element/wheel_event title="The wheel event fires when the user rotates a wheel button on a pointing device (typically a mouse).">Element/wheel_event</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>17+</span></span><span class="safari yes"><span>Safari</span><span>7+</span></span><span class="chrome yes"><span>Chrome</span><span>31+</span></span><hr><span class="opera unknown"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>Internet Explorer</span><span>9+</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios no"><span>Safari iOS</span><span>No</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android unknown"><span>WebView Android</span><span>?</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android unknown"><span>Opera Android</span><span>?</span></span></div></div></div><td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-wheel><a data-x-internal=event-wheel href=https://w3c.github.io/uievents/#event-type-wheel>wheel</a></code> 


 

 
  </table>

  <hr>

  <p>The following are the <a href=#event-handlers id=event-handlers-on-elements,-document-objects,-and-window-objects:event-handlers-3>event handlers</a> (and their corresponding <span>event handler event types</span>) 
  supported by all <a id=event-handlers-on-elements,-document-objects,-and-window-objects:html-elements-2 href=infrastructure.html#html-elements>HTML elements</a> other than <code id=event-handlers-on-elements,-document-objects,-and-window-objects:the-body-element><a href=sections.html#the-body-element>body</a></code> and <code>frameset</code>
  elements, as both <a href=#event-handler-content-attributes id=event-handlers-on-elements,-document-objects,-and-window-objects:event-handler-content-attributes-2>event handler content attributes</a> and <a href=#event-handler-idl-attributes id=event-handlers-on-elements,-document-objects,-and-window-objects:event-handler-idl-attributes-3>event handler IDL
  attributes</a>;  supported by all <code>Document</code>
  objects, as <a href=#event-handler-idl-attributes id=event-handlers-on-elements,-document-objects,-and-window-objects:event-handler-idl-attributes-4>event handler IDL attributes</a>; and 
  supported by all <code>Window</code> objects, as <a href=#event-handler-idl-attributes id=event-handlers-on-elements,-document-objects,-and-window-objects:event-handler-idl-attributes-5>event handler IDL attributes</a> on the
  <code>Window</code> objects themselves, and with corresponding <a href=#event-handler-content-attributes id=event-handlers-on-elements,-document-objects,-and-window-objects:event-handler-content-attributes-3>event handler content
  attributes</a> and <a href=#event-handler-idl-attributes id=event-handlers-on-elements,-document-objects,-and-window-objects:event-handler-idl-attributes-6>event handler IDL attributes</a> exposed on all <code id=event-handlers-on-elements,-document-objects,-and-window-objects:the-body-element-2><a href=sections.html#the-body-element>body</a></code>
  and <code>frameset</code> elements that are owned by that <code>Window</code> object's <span>associated <code>Document</code></span>:</p>

  <table><thead><tr><th><a href=#event-handlers id=event-handlers-on-elements,-document-objects,-and-window-objects:event-handlers-4>Event handler</a> <th><span>Event handler event type</span>
   <tbody><tr><td><dfn data-dfn-for=GlobalEventHandlers id=handler-onblur data-dfn-type=attribute><code>onblur</code></dfn> <div class="mdn-anno wrapped before"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/Element/blur_event title="The blur event fires when an element has lost focus. The event does not bubble, but the related focusout event that follows does bubble.">Element/blur_event</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>24+</span></span><span class="safari yes"><span>Safari</span><span>3.1+</span></span><span class="chrome yes"><span>Chrome</span><span>1+</span></span><hr><span class="opera yes"><span>Opera</span><span>11.6+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>Internet Explorer</span><span>9+</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios unknown"><span>Safari iOS</span><span>?</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android unknown"><span>WebView Android</span><span>?</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Android</span><span>12.1+</span></span></div></div><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/Window/blur_event title="The blur event fires when an element has lost focus.">Window/blur_event</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>6+</span></span><span class="safari yes"><span>Safari</span><span>5.1+</span></span><span class="chrome yes"><span>Chrome</span><span>5+</span></span><hr><span class="opera yes"><span>Opera</span><span>12.1+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>Internet Explorer</span><span>11</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios unknown"><span>Safari iOS</span><span>?</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android yes"><span>WebView Android</span><span>37+</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Android</span><span>12.1+</span></span></div></div></div><td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-blur><a href=indices.html#event-blur>blur</a></code> 
    <tr><td><dfn data-dfn-for=GlobalEventHandlers id=handler-onerror data-dfn-type=attribute><code>onerror</code></dfn> <div class="mdn-anno wrapped before"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/Window/error_event title="The error event is fired on a Window object when a resource failed to load or couldn't be used — for example if a script has an execution error.">Window/error_event</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>6+</span></span><span class="safari yes"><span>Safari</span><span>5.1+</span></span><span class="chrome yes"><span>Chrome</span><span>10+</span></span><hr><span class="opera unknown"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>Internet Explorer</span><span>9+</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios unknown"><span>Safari iOS</span><span>?</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android yes"><span>WebView Android</span><span>37+</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android unknown"><span>Opera Android</span><span>?</span></span></div></div></div><td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-error><a href=indices.html#event-error>error</a></code>
    <tr><td><dfn data-dfn-for=GlobalEventHandlers id=handler-onfocus data-dfn-type=attribute><code>onfocus</code></dfn> <div class="mdn-anno wrapped before"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/Element/focus_event title="The focus event fires when an element has received focus. The event does not bubble, but the related focusin event that follows does bubble.">Element/focus_event</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>24+</span></span><span class="safari yes"><span>Safari</span><span>3.1+</span></span><span class="chrome yes"><span>Chrome</span><span>1+</span></span><hr><span class="opera yes"><span>Opera</span><span>11.6+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>Internet Explorer</span><span>9+</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios unknown"><span>Safari iOS</span><span>?</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android unknown"><span>WebView Android</span><span>?</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Android</span><span>12.1+</span></span></div></div><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/Window/focus_event title="The focus event fires when an element has received focus.">Window/focus_event</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>6+</span></span><span class="safari yes"><span>Safari</span><span>5.1+</span></span><span class="chrome yes"><span>Chrome</span><span>5+</span></span><hr><span class="opera yes"><span>Opera</span><span>12.1+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>Internet Explorer</span><span>11</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios unknown"><span>Safari iOS</span><span>?</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android yes"><span>WebView Android</span><span>37+</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Android</span><span>12.1+</span></span></div></div></div><td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-focus><a href=indices.html#event-focus>focus</a></code> 
    <tr><td><dfn data-dfn-for=GlobalEventHandlers id=handler-onload data-dfn-type=attribute><code>onload</code></dfn> <td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-load><a href=indices.html#event-load>load</a></code>
    <tr><td><dfn data-dfn-for=GlobalEventHandlers id=handler-onresize data-dfn-type=attribute><code>onresize</code></dfn> <td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-resize><a data-x-internal=event-resize href=https://drafts.csswg.org/cssom-view/#eventdef-window-resize>resize</a></code>
    <tr><td><dfn data-dfn-for=GlobalEventHandlers id=handler-onscroll data-dfn-type=attribute><code>onscroll</code></dfn> <div class="mdn-anno wrapped before"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/Document/scroll_event title="The scroll event fires when the document view has been scrolled. To detect when scrolling has completed, see the Document: scrollend event. For element scrolling, see Element: scroll event.">Document/scroll_event</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>6+</span></span><span class="safari yes"><span>Safari</span><span>2+</span></span><span class="chrome yes"><span>Chrome</span><span>1+</span></span><hr><span class="opera yes"><span>Opera</span><span>11.6+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>Internet Explorer</span><span>9+</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios unknown"><span>Safari iOS</span><span>?</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android unknown"><span>WebView Android</span><span>?</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Android</span><span>12+</span></span></div></div><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/Element/scroll_event title="The scroll event fires when an element has been scrolled. To detect when scrolling has completed, see the Element: scrollend event.">Element/scroll_event</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>6+</span></span><span class="safari yes"><span>Safari</span><span>1.3+</span></span><span class="chrome yes"><span>Chrome</span><span>1+</span></span><hr><span class="opera yes"><span>Opera</span><span>12.1+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>Internet Explorer</span><span>9+</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios unknown"><span>Safari iOS</span><span>?</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android unknown"><span>WebView Android</span><span>?</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Android</span><span>12.1+</span></span></div></div></div><td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-scroll><a data-x-internal=event-scroll href=https://drafts.csswg.org/cssom-view/#eventdef-document-scroll>scroll</a></code>
  </table>

  <p>We call the <a id=event-handlers-on-elements,-document-objects,-and-window-objects:set href=https://infra.spec.whatwg.org/#ordered-set data-x-internal=set>set</a> of the <a href=#event-handler-name id=event-handlers-on-elements,-document-objects,-and-window-objects:event-handler-name>names</a> of the
  <a href=#event-handlers id=event-handlers-on-elements,-document-objects,-and-window-objects:event-handlers-5>event handlers</a> listed in the first column of this table the
  <dfn id=window-reflecting-body-element-event-handler-set><code>Window</code>-reflecting body element event handler set</dfn>.</p>

  <hr>

  <p>The following are the <a href=#event-handlers id=event-handlers-on-elements,-document-objects,-and-window-objects:event-handlers-6>event handlers</a> (and their corresponding <span>event handler event types</span>) 
  supported by <code>Window</code> objects, as <a href=#event-handler-idl-attributes id=event-handlers-on-elements,-document-objects,-and-window-objects:event-handler-idl-attributes-7>event handler IDL attributes</a> on the
  <code>Window</code> objects themselves, and with corresponding <a href=#event-handler-content-attributes id=event-handlers-on-elements,-document-objects,-and-window-objects:event-handler-content-attributes-4>event handler content
  attributes</a> and <a href=#event-handler-idl-attributes id=event-handlers-on-elements,-document-objects,-and-window-objects:event-handler-idl-attributes-8>event handler IDL attributes</a> exposed on all <code id=event-handlers-on-elements,-document-objects,-and-window-objects:the-body-element-3><a href=sections.html#the-body-element>body</a></code>
  and <code>frameset</code> elements that are owned by that <code>Window</code> object's <span>associated <code>Document</code></span>:</p>

  <table><thead><tr><th><a href=#event-handlers id=event-handlers-on-elements,-document-objects,-and-window-objects:event-handlers-7>Event handler</a> <th><span>Event handler event type</span>
   <tbody><tr><td><dfn data-dfn-for=WindowEventHandlers id=handler-window-onafterprint data-dfn-type=attribute><code>onafterprint</code></dfn> <div class="mdn-anno wrapped before"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/Window/afterprint_event title="The afterprint event is fired after the associated document has started printing or the print preview has been closed.">Window/afterprint_event</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>6+</span></span><span class="safari yes"><span>Safari</span><span>13+</span></span><span class="chrome yes"><span>Chrome</span><span>63+</span></span><hr><span class="opera unknown"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>Internet Explorer</span><span>9+</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios unknown"><span>Safari iOS</span><span>?</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android unknown"><span>WebView Android</span><span>?</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android unknown"><span>Opera Android</span><span>?</span></span></div></div></div><td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-afterprint><a href=indices.html#event-afterprint>afterprint</a></code>
    <tr><td><dfn data-dfn-for=WindowEventHandlers id=handler-window-onbeforeprint data-dfn-type=attribute><code>onbeforeprint</code></dfn> <div class="mdn-anno wrapped before"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeprint_event title="The beforeprint event is fired when the associated document is about to be printed or previewed for printing.">Window/beforeprint_event</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>6+</span></span><span class="safari yes"><span>Safari</span><span>13+</span></span><span class="chrome yes"><span>Chrome</span><span>63+</span></span><hr><span class="opera unknown"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>Internet Explorer</span><span>9+</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios unknown"><span>Safari iOS</span><span>?</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android unknown"><span>WebView Android</span><span>?</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android unknown"><span>Opera Android</span><span>?</span></span></div></div></div><td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-beforeprint><a href=indices.html#event-beforeprint>beforeprint</a></code>
    <tr><td><dfn data-dfn-for=WindowEventHandlers id=handler-window-onbeforeunload data-dfn-type=attribute><code>onbeforeunload</code></dfn> <div class="mdn-anno wrapped before"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event title="The beforeunload event is fired when the window, the document and its resources are about to be unloaded. The document is still visible and the event is still cancelable at this point.">Window/beforeunload_event</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>1+</span></span><span class="safari yes"><span>Safari</span><span>3+</span></span><span class="chrome yes"><span>Chrome</span><span>1+</span></span><hr><span class="opera yes"><span>Opera</span><span>12+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>Internet Explorer</span><span>4+</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios yes"><span>Safari iOS</span><span>1+</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android unknown"><span>WebView Android</span><span>?</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Android</span><span>12+</span></span></div></div></div><td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-beforeunload><a href=indices.html#event-beforeunload>beforeunload</a></code>
    <tr><td><dfn data-dfn-for=WindowEventHandlers id=handler-window-onhashchange data-dfn-type=attribute><code>onhashchange</code></dfn> <div class="mdn-anno wrapped before"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/Window/hashchange_event title="The hashchange event is fired when the fragment identifier of the URL has changed (the part of the URL beginning with and following the # symbol).">Window/hashchange_event</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>3.6+</span></span><span class="safari yes"><span>Safari</span><span>5+</span></span><span class="chrome yes"><span>Chrome</span><span>8+</span></span><hr><span class="opera yes"><span>Opera</span><span>10.6+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>Internet Explorer</span><span>8+</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios yes"><span>Safari iOS</span><span>5+</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android yes"><span>WebView Android</span><span>37+</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Android</span><span>11+</span></span></div></div></div><td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-hashchange><a href=indices.html#event-hashchange>hashchange</a></code> 
    <tr><td><dfn data-dfn-for=WindowEventHandlers id=handler-window-onlanguagechange data-dfn-type=attribute><code>onlanguagechange</code></dfn> <div class="mdn-anno wrapped before"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/Window/languagechange_event title="The languagechange event is fired at the global scope object when the user's preferred language changes.">Window/languagechange_event</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>32+</span></span><span class="safari yes"><span>Safari</span><span>10.1+</span></span><span class="chrome yes"><span>Chrome</span><span>37+</span></span><hr><span class="opera unknown"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge unknown"><span>Edge (Legacy)</span><span>?</span></span><span class="ie no"><span>Internet Explorer</span><span>No</span></span><hr><span class="firefox_android yes"><span>Firefox Android</span><span>4+</span></span><span class="safari_ios unknown"><span>Safari iOS</span><span>?</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android unknown"><span>WebView Android</span><span>?</span></span><span class="samsunginternet_android yes"><span>Samsung Internet</span><span>4.0+</span></span><span class="opera_android unknown"><span>Opera Android</span><span>?</span></span></div></div></div><td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-languagechange><a href=indices.html#event-languagechange>languagechange</a></code> 
    <tr><td><dfn data-dfn-for=WindowEventHandlers id=handler-window-onmessage data-dfn-type=attribute><code>onmessage</code></dfn> <div class="mdn-anno wrapped before"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/Window/message_event title="The message event is fired on a Window object when the window receives a message, for example from a call to Window.postMessage() from another browsing context.">Window/message_event</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>9+</span></span><span class="safari yes"><span>Safari</span><span>4+</span></span><span class="chrome yes"><span>Chrome</span><span>60+</span></span><hr><span class="opera unknown"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>Internet Explorer</span><span>8+</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios yes"><span>Safari iOS</span><span>4+</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android unknown"><span>WebView Android</span><span>?</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Android</span><span>47+</span></span></div></div></div><td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-message><a href=indices.html#event-message>message</a></code> 
    <tr><td><dfn data-dfn-for=WindowEventHandlers id=handler-window-onmessageerror data-dfn-type=attribute><code>onmessageerror</code></dfn> <div class="mdn-anno wrapped before"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/error_event title="The error event is fired when the resource could not be loaded due to an error (for example, a network connectivity problem).">HTMLMediaElement/error_event</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>6+</span></span><span class="safari yes"><span>Safari</span><span>3.1+</span></span><span class="chrome yes"><span>Chrome</span><span>3+</span></span><hr><span class="opera yes"><span>Opera</span><span>11.6+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>Internet Explorer</span><span>9+</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios yes"><span>Safari iOS</span><span>3+</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android unknown"><span>WebView Android</span><span>?</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Android</span><span>12+</span></span></div></div><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/Window/messageerror_event title="The messageerror event is fired on a Window object when it receives a message that can't be deserialized.">Window/messageerror_event</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>57+</span></span><span class="safari yes"><span>Safari</span><span>16.4+</span></span><span class="chrome yes"><span>Chrome</span><span>60+</span></span><hr><span class="opera unknown"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge yes"><span>Edge (Legacy)</span><span>18</span></span><span class="ie no"><span>Internet Explorer</span><span>No</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios unknown"><span>Safari iOS</span><span>?</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android unknown"><span>WebView Android</span><span>?</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Android</span><span>47+</span></span></div></div></div><td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-messageerror><a href=indices.html#event-messageerror>messageerror</a></code> 
    <tr><td><dfn data-dfn-for=WindowEventHandlers id=handler-window-onoffline data-dfn-type=attribute><code>onoffline</code></dfn> <div class="mdn-anno wrapped before"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/Window/offline_event title="The offline event of the Window interface is fired when the browser has lost access to the network and the value of Navigator.onLine switches to false.">Window/offline_event</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>9+</span></span><span class="safari yes"><span>Safari</span><span>4+</span></span><span class="chrome yes"><span>Chrome</span><span>3+</span></span><hr><span class="opera unknown"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>Internet Explorer</span><span>9+</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios yes"><span>Safari iOS</span><span>3+</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android yes"><span>WebView Android</span><span>37+</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android unknown"><span>Opera Android</span><span>?</span></span></div></div></div><td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-offline><a href=indices.html#event-offline>offline</a></code> 
    <tr><td><dfn data-dfn-for=WindowEventHandlers id=handler-window-ononline data-dfn-type=attribute><code>ononline</code></dfn> <div class="mdn-anno wrapped before"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/Window/online_event title="The online event of the Window interface is fired when the browser has gained access to the network and the value of Navigator.onLine switches to true.">Window/online_event</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>9+</span></span><span class="safari yes"><span>Safari</span><span>4+</span></span><span class="chrome yes"><span>Chrome</span><span>3+</span></span><hr><span class="opera unknown"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>Internet Explorer</span><span>9+</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios yes"><span>Safari iOS</span><span>3+</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android yes"><span>WebView Android</span><span>37+</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android unknown"><span>Opera Android</span><span>?</span></span></div></div></div><td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-online><a href=indices.html#event-online>online</a></code> 
    <tr><td><dfn data-dfn-for=WindowEventHandlers id=handler-window-onpageswap data-dfn-type=attribute><code>onpageswap</code></dfn> <td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-pageswap><a href=indices.html#event-pageswap>pageswap</a></code> 
    <tr><td><dfn data-dfn-for=WindowEventHandlers id=handler-window-onpagehide data-dfn-type=attribute><code>onpagehide</code></dfn> <td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-pagehide><a href=indices.html#event-pagehide>pagehide</a></code> 
    <tr><td><dfn data-dfn-for=WindowEventHandlers id=handler-window-onpagereveal data-dfn-type=attribute><code>onpagereveal</code></dfn> <td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-pagereveal><a href=indices.html#event-pagereveal>pagereveal</a></code> 
    <tr><td><dfn data-dfn-for=WindowEventHandlers id=handler-window-onpageshow data-dfn-type=attribute><code>onpageshow</code></dfn> <td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-pageshow><a href=indices.html#event-pageshow>pageshow</a></code> 
    <tr><td><dfn data-dfn-for=WindowEventHandlers id=handler-window-onpopstate data-dfn-type=attribute><code>onpopstate</code></dfn> <div class="mdn-anno wrapped before"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/Window/popstate_event title="The popstate event of the Window interface is fired when the active history entry changes while the user navigates the session history. It changes the current history entry to that of the last page the user visited or, if history.pushState() has been used to add a history entry to the history stack, that history entry is used instead.">Window/popstate_event</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>4+</span></span><span class="safari yes"><span>Safari</span><span>5+</span></span><span class="chrome yes"><span>Chrome</span><span>5+</span></span><hr><span class="opera yes"><span>Opera</span><span>11.5+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>Internet Explorer</span><span>10+</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios unknown"><span>Safari iOS</span><span>?</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android yes"><span>WebView Android</span><span>37+</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Android</span><span>11.5+</span></span></div></div></div><td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-popstate><a href=indices.html#event-popstate>popstate</a></code> 
    <tr><td><dfn data-dfn-for=WindowEventHandlers id=handler-window-onrejectionhandled data-dfn-type=attribute><code>onrejectionhandled</code></dfn> <div class="mdn-anno wrapped before"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/Window/rejectionhandled_event title="The rejectionhandled event is sent to the script's global scope (usually window but also Worker) whenever a rejected JavaScript Promise is handled late, i.e. when a handler is attached to the promise after its rejection had caused an unhandledrejection event.">Window/rejectionhandled_event</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>69+</span></span><span class="safari yes"><span>Safari</span><span>11+</span></span><span class="chrome yes"><span>Chrome</span><span>49+</span></span><hr><span class="opera unknown"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge unknown"><span>Edge (Legacy)</span><span>?</span></span><span class="ie no"><span>Internet Explorer</span><span>No</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios yes"><span>Safari iOS</span><span>11.3+</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android unknown"><span>WebView Android</span><span>?</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android unknown"><span>Opera Android</span><span>?</span></span></div></div></div><td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-rejectionhandled><a href=indices.html#event-rejectionhandled>rejectionhandled</a></code>
    <tr><td><dfn data-dfn-for=WindowEventHandlers id=handler-window-onstorage data-dfn-type=attribute><code>onstorage</code></dfn> <div class="mdn-anno wrapped before"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/Window/storage_event title="The storage event of the Window interface fires when a storage area (localStorage) has been modified in the context of another document.">Window/storage_event</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>45+</span></span><span class="safari yes"><span>Safari</span><span>4+</span></span><span class="chrome yes"><span>Chrome</span><span>1+</span></span><hr><span class="opera unknown"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge yes"><span>Edge (Legacy)</span><span>15+</span></span><span class="ie yes"><span>Internet Explorer</span><span>9+</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios yes"><span>Safari iOS</span><span>4+</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android yes"><span>WebView Android</span><span>37+</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android unknown"><span>Opera Android</span><span>?</span></span></div></div></div><td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-storage><a href=indices.html#event-storage>storage</a></code> 
    <tr><td><dfn data-dfn-for=WindowEventHandlers id=handler-window-onunhandledrejection data-dfn-type=attribute><code>onunhandledrejection</code></dfn> <div class="mdn-anno wrapped before"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/Window/unhandledrejection_event title="The unhandledrejection event is sent to the global scope of a script when a JavaScript Promise that has no rejection handler is rejected; typically, this is the window, but may also be a Worker.">Window/unhandledrejection_event</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>69+</span></span><span class="safari yes"><span>Safari</span><span>11+</span></span><span class="chrome yes"><span>Chrome</span><span>49+</span></span><hr><span class="opera unknown"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge unknown"><span>Edge (Legacy)</span><span>?</span></span><span class="ie no"><span>Internet Explorer</span><span>No</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios yes"><span>Safari iOS</span><span>11.3+</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android unknown"><span>WebView Android</span><span>?</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android unknown"><span>Opera Android</span><span>?</span></span></div></div></div><td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-unhandledrejection><a href=indices.html#event-unhandledrejection>unhandledrejection</a></code>
    <tr><td><dfn data-dfn-for=WindowEventHandlers id=handler-window-onunload data-dfn-type=attribute><code>onunload</code></dfn> <div class="mdn-anno wrapped before"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/Window/unload_event title="The unload event is fired when the document or a child resource is being unloaded.">Window/unload_event</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>1+</span></span><span class="safari yes"><span>Safari</span><span>3+</span></span><span class="chrome yes"><span>Chrome</span><span>1+</span></span><hr><span class="opera yes"><span>Opera</span><span>4+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>Internet Explorer</span><span>4+</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios yes"><span>Safari iOS</span><span>1+</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android unknown"><span>WebView Android</span><span>?</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Android</span><span>10.1+</span></span></div></div></div><td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-unload><a href=indices.html#event-unload>unload</a></code> 
  </table>

  

  <hr>

  <p>The following are the <a href=#event-handlers id=event-handlers-on-elements,-document-objects,-and-window-objects:event-handlers-8>event handlers</a> (and their corresponding <span>event handler event types</span>) 
  supported on <code>Document</code> objects as <a href=#event-handler-idl-attributes id=event-handlers-on-elements,-document-objects,-and-window-objects:event-handler-idl-attributes-9>event handler IDL attributes</a>:</p>

  

  <table><thead><tr><th><a href=#event-handlers id=event-handlers-on-elements,-document-objects,-and-window-objects:event-handlers-9>Event handler</a> <th><span>Event handler event type</span>
   <tbody><tr><td><dfn data-dfn-for=Document id=handler-onreadystatechange data-dfn-type=attribute><code>onreadystatechange</code></dfn> <td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-readystatechange><a href=indices.html#event-readystatechange>readystatechange</a></code>
    <tr><td><dfn data-dfn-for=Document id=handler-onvisibilitychange data-dfn-type=attribute><code>onvisibilitychange</code></dfn> <div class="mdn-anno wrapped before"><button onclick=toggleStatus(this) class=mdn-anno-btn><b title="Support in all current engines." class=all-engines-flag>✔</b><span>MDN</span></button><div class=feature><p><a href=https://developer.mozilla.org/en-US/docs/Web/API/Document/visibilitychange_event title="The visibilitychange event is fired at the document when the contents of its tab have become visible or have been hidden.">Document/visibilitychange_event</a><p class=all-engines-text>Support in all current engines.<div class=support><span class="firefox yes"><span>Firefox</span><span>56+</span></span><span class="safari yes"><span>Safari</span><span>14.1+</span></span><span class="chrome yes"><span>Chrome</span><span>62+</span></span><hr><span class="opera yes"><span>Opera</span><span>49+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span><hr><span class="edge yes"><span>Edge (Legacy)</span><span>18</span></span><span class="ie yes"><span>Internet Explorer</span><span title="Partial implementation.">🔰 10+</span></span><hr><span class="firefox_android unknown"><span>Firefox Android</span><span>?</span></span><span class="safari_ios unknown"><span>Safari iOS</span><span>?</span></span><span class="chrome_android unknown"><span>Chrome Android</span><span>?</span></span><span class="webview_android yes"><span>WebView Android</span><span>62+</span></span><span class="samsunginternet_android unknown"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Android</span><span>46+</span></span></div></div></div><td> <code id=event-handlers-on-elements,-document-objects,-and-window-objects:event-visibilitychange><a href=indices.html#event-visibilitychange>visibilitychange</a></code>
  </table>


  


  <h3 id=windoworworkerglobalscope-mixin><span class=secno>8.2</span> The <code>WindowOrWorkerGlobalScope</code> mixin<a href=#windoworworkerglobalscope-mixin class=self-link></a></h3>

  <p>The <code>WindowOrWorkerGlobalScope</code> mixin is for use of APIs that are to be exposed on
  <code>Window</code> and <code id=windoworworkerglobalscope-mixin:workerglobalscope><a href=workers.html#workerglobalscope>WorkerGlobalScope</a></code> objects.</p>

  <p class=note>Other standards are encouraged to further extend it using <code>partial
  interface mixin <span>WindowOrWorkerGlobalScope</span> { … };</code> along with an
  appropriate reference.</p>

  

  <dl class=domintro><dt><code>self.<span id=dom-issecurecontext>isSecureContext</span></code><dd><p>Returns whether or not this global object represents a <span>secure context</span>.
   <a href=references.html#refsSECURE-CONTEXTS>[SECURE-CONTEXTS]</a><dt><code>self.<span id=dom-origin>origin</span></code><dd><p>Returns the global object's <a id=windoworworkerglobalscope-mixin:concept-origin href=browsers.html#concept-origin>origin</a>, serialized as string.<dt><code>self.<span id=dom-crossoriginisolated>crossOriginIsolated</span></code><dd><p>Returns whether scripts running in this global are allowed to use APIs that require
   cross-origin isolation. This depends on the `<code id=windoworworkerglobalscope-mixin:cross-origin-opener-policy-2><a href=browsers.html#cross-origin-opener-policy-2>Cross-Origin-Opener-Policy</a></code>` and
   `<code id=windoworworkerglobalscope-mixin:cross-origin-embedder-policy><a href=browsers.html#cross-origin-embedder-policy>Cross-Origin-Embedder-Policy</a></code>` HTTP response headers and the "<code id=windoworworkerglobalscope-mixin:cross-origin-isolated-feature><a href=infrastructure.html#cross-origin-isolated-feature>cross-origin-isolated</a></code>" feature.</dl>

  <div class=example>
   <p>Developers are strongly encouraged to use <code>self.origin</code> over <code>location.origin</code>. The former returns the <a id=windoworworkerglobalscope-mixin:concept-origin-2 href=browsers.html#concept-origin>origin</a> of the environment,
   the latter of the URL of the environment. Imagine the following script executing in a document on
   <code>https://stargate.example/</code>:</p>

   <pre><code class='js'><c- a>var</c-> frame <c- o>=</c-> document<c- p>.</c->createElement<c- p>(</c-><c- u>&quot;iframe&quot;</c-><c- p>)</c->
frame<c- p>.</c->onload <c- o>=</c-> <c- a>function</c-><c- p>()</c-> <c- p>{</c->
  <c- a>var</c-> frameWin <c- o>=</c-> frame<c- p>.</c->contentWindow
  console<c- p>.</c->log<c- p>(</c->frameWin<c- p>.</c->location<c- p>.</c->origin<c- p>)</c-> <c- c1>// &quot;null&quot;</c->
  console<c- p>.</c->log<c- p>(</c->frameWin<c- p>.</c->origin<c- p>)</c-> <c- c1>// &quot;https://stargate.example&quot;</c->
<c- p>}</c->
document<c- p>.</c->body<c- p>.</c->appendChild<c- p>(</c->frame<c- p>)</c-></code></pre>

   <p><code>self.origin</code> is a more reliable security indicator.</p>
  </div>

  


  <h3 id=atob><span class=secno>8.3</span> Base64 utility methods<a href=#atob class=self-link></a></h3>

  <p>The <code id=atob:dom-atob><a href=#dom-atob>atob()</a></code> and <code id=atob:dom-btoa><a href=#dom-btoa>btoa()</a></code> methods
  allow developers to transform content to and from the base64 encoding.</p>

  <p class=note>In these APIs, for mnemonic purposes, the "b" can be considered to stand for
  "binary", and the "a" for "ASCII". In practice, though, for primarily historical reasons, both the
  input and output of these functions are Unicode strings.</p>

  <dl class=domintro><dt><code><var>result</var> = self.<span id=dom-btoa>btoa</span>(<var>data</var>)</code><dd>
    <p>Takes the input data, in the form of a Unicode string containing only characters in the range
    U+0000 to U+00FF, each representing a binary byte with values 0x00 to 0xFF respectively, and
    converts it to its base64 representation, which it returns.</p>

    <p>Throws an <a id=atob:invalidcharactererror href=https://webidl.spec.whatwg.org/#invalidcharactererror data-x-internal=invalidcharactererror>"<code>InvalidCharacterError</code>"</a> <code id=atob:domexception><a data-x-internal=domexception href=https://webidl.spec.whatwg.org/#dfn-DOMException>DOMException</a></code>
    if the input string contains any out-of-range characters.</p>
   <dt><code><var>result</var> = self.<span id=dom-atob>atob</span>(<var>data</var>)</code><dd>
    <p>Takes the input data, in the form of a Unicode string containing base64-encoded binary data,
    decodes it, and returns a string consisting of characters in the range U+0000 to U+00FF, each
    representing a binary byte with values 0x00 to 0xFF respectively, corresponding to that binary
    data.</p>

    <p>Throws an <a id=atob:invalidcharactererror-2 href=https://webidl.spec.whatwg.org/#invalidcharactererror data-x-internal=invalidcharactererror>"<code>InvalidCharacterError</code>"</a> <code id=atob:domexception-2><a data-x-internal=domexception href=https://webidl.spec.whatwg.org/#dfn-DOMException>DOMException</a></code> if the
    input string is not valid base64 data.</p>
   </dl>

  


  <nav><a href=speculative-loading.html>← 7.6 Speculative loading</a> — <a href=index.html>Table of Contents</a> — <a href=dynamic-markup-insertion.html>8.4 Dynamic markup insertion →</a></nav>
